summaryrefslogtreecommitdiff
path: root/proto/rip
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-05-17 15:21:49 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-05-17 15:21:49 +0200
commit08b3a24da5bbd1bab09d6a2400cdf7705d5e18a7 (patch)
tree41335bdccfca47f09d4aaa3da01038068714af84 /proto/rip
parent5af7b59660be615fbbd7c20b92b71321c003c43a (diff)
IO: Minor changes in socket AF handing
AF can be specified implicitly by saddr or daddr, flags SKF_V4ONLY and SKF_V6ONLY are to be removed.
Diffstat (limited to 'proto/rip')
-rw-r--r--proto/rip/config.Y2
-rw-r--r--proto/rip/packets.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/proto/rip/config.Y b/proto/rip/config.Y
index 3c8cd0f2..61a2a101 100644
--- a/proto/rip/config.Y
+++ b/proto/rip/config.Y
@@ -123,7 +123,7 @@ rip_iface_item:
| MODE MULTICAST { RIP_IFACE->mode = RIP_IM_MULTICAST; }
| MODE BROADCAST { RIP_IFACE->mode = RIP_IM_BROADCAST; if (rip_cfg_is_ng()) cf_error("Broadcast not supported in RIPng"); }
| PASSIVE bool { RIP_IFACE->passive = $2; }
- | ADDRESS ipa { RIP_IFACE->address = $2; }
+ | ADDRESS ipa { RIP_IFACE->address = $2; if (ipa_is_ip4($2) != rip_cfg_is_v2()) cf_error("IP address version mismatch"); }
| PORT expr { RIP_IFACE->port = $2; if (($2<1) || ($2>65535)) cf_error("Invalid port number"); }
| VERSION expr { RIP_IFACE->version = $2;
if (rip_cfg_is_ng()) cf_error("Version not supported in RIPng");
diff --git a/proto/rip/packets.c b/proto/rip/packets.c
index 488ac9df..f89bb178 100644
--- a/proto/rip/packets.c
+++ b/proto/rip/packets.c
@@ -715,7 +715,7 @@ rip_open_socket(struct rip_iface *ifa)
sock *sk = sk_new(p->p.pool);
sk->type = SK_UDP;
- sk->fam = rip_is_v2(p) ? SK_FAM_IPV4 : SK_FAM_IPV6;
+ sk->subtype = rip_is_v2(p) ? SK_IPV4 : SK_IPV6;
sk->sport = ifa->cf->port;
sk->dport = ifa->cf->port;
sk->iface = ifa->iface;
@@ -736,8 +736,7 @@ rip_open_socket(struct rip_iface *ifa)
sk->tos = ifa->cf->tx_tos;
sk->priority = ifa->cf->tx_priority;
sk->ttl = ifa->cf->ttl_security ? 255 : 1;
- sk->flags = SKF_LADDR_RX | (rip_is_ng(p) ? SKF_V6ONLY : 0) |
- ((ifa->cf->ttl_security == 1) ? SKF_TTL_RX : 0);
+ sk->flags = SKF_LADDR_RX | ((ifa->cf->ttl_security == 1) ? SKF_TTL_RX : 0);
/* sk->rbsize and sk->tbsize are handled in rip_iface_update_buffers() */