diff options
author | Dmitrij Tejblum <tejblum@yandex-team.ru> | 2011-08-18 20:22:17 +0400 |
---|---|---|
committer | Denis Ovsienko <infrastation@yandex.ru> | 2011-09-27 21:37:35 +0400 |
commit | 69bf3a39931ce61a92fb04d8888b4655fd5620a2 (patch) | |
tree | e49dae20b1dbc0d1ee37121cd45c75d94290bdd1 /ripd | |
parent | ea4021984f9eec3f2a85551ae0822e1dff0ed2bc (diff) |
lib: simplify interface of setsockopt_multicast_ipv4().
* sockopt.[ch] (setsockopt_ipv4_multicast): ifindex is now mandatory (all
non-ancient OSes can use it anyway), and if_addr parameter (the address
of the interface) is now gone. (setsockopt_ipv4_multicast_if):
IP_MULTICAST_IF processing moved to this new function
* ospf_network.c (ospf_if_add_allspfrouters, ospf_if_drop_allspfrouters,
ospf_if_add_alldrouters, ospf_if_drop_alldrouters, ospf_if_ipmulticast),
rip_interface.c (ipv4_multicast_join, ipv4_multicast_leave,
rip_interface_new): adapt to the new interface
Diffstat (limited to 'ripd')
-rw-r--r-- | ripd/rip_interface.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index d3b55fc0..810b71c0 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -78,9 +78,8 @@ ipv4_multicast_join (int sock, { int ret; - ret = setsockopt_multicast_ipv4 (sock, + ret = setsockopt_ipv4_multicast (sock, IP_ADD_MEMBERSHIP, - ifa, group.s_addr, ifindex); @@ -100,9 +99,8 @@ ipv4_multicast_leave (int sock, { int ret; - ret = setsockopt_multicast_ipv4 (sock, + ret = setsockopt_ipv4_multicast (sock, IP_DROP_MEMBERSHIP, - ifa, group.s_addr, ifindex); @@ -138,18 +136,13 @@ rip_interface_new (void) void rip_interface_multicast_set (int sock, struct connected *connected) { - struct in_addr addr; - assert (connected != NULL); - addr = CONNECTED_ID(connected)->u.prefix4; - - if (setsockopt_multicast_ipv4 (sock, IP_MULTICAST_IF, addr, 0, - connected->ifp->ifindex) < 0) + if (setsockopt_ipv4_multicast_if (sock, connected->ifp->ifindex) < 0) { zlog_warn ("Can't setsockopt IP_MULTICAST_IF on fd %d to " - "source address %s for interface %s", - sock, inet_ntoa(addr), + "ifindex %d for interface %s", + sock, connected->ifp->ifindex, connected->ifp->name); } |