summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorDmitrij Tejblum <tejblum@yandex-team.ru>2011-08-18 20:22:17 +0400
committerDmitrij Tejblum <tejblum@yandex-team.ru>2011-08-19 22:02:17 +0400
commitbf510e9bc06b55ae9d9c1d6ed67152b94e80977e (patch)
tree4466103c8ad05307cbd88c7509c8ff03976f260f /ospfd
parent9fa6be78ecbbda17be20b8d2bc4fdde915e33d7e (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 'ospfd')
-rw-r--r--ospfd/ospf_network.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c
index 1e2d44e6..3e326a8c 100644
--- a/ospfd/ospf_network.c
+++ b/ospfd/ospf_network.c
@@ -52,8 +52,8 @@ ospf_if_add_allspfrouters (struct ospf *top, struct prefix *p,
{
int ret;
- ret = setsockopt_multicast_ipv4 (top->fd, IP_ADD_MEMBERSHIP,
- p->u.prefix4, htonl (OSPF_ALLSPFROUTERS),
+ ret = setsockopt_ipv4_multicast (top->fd, IP_ADD_MEMBERSHIP,
+ htonl (OSPF_ALLSPFROUTERS),
ifindex);
if (ret < 0)
zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
@@ -73,8 +73,8 @@ ospf_if_drop_allspfrouters (struct ospf *top, struct prefix *p,
{
int ret;
- ret = setsockopt_multicast_ipv4 (top->fd, IP_DROP_MEMBERSHIP,
- p->u.prefix4, htonl (OSPF_ALLSPFROUTERS),
+ ret = setsockopt_ipv4_multicast (top->fd, IP_DROP_MEMBERSHIP,
+ htonl (OSPF_ALLSPFROUTERS),
ifindex);
if (ret < 0)
zlog_warn ("can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %s, "
@@ -94,8 +94,8 @@ ospf_if_add_alldrouters (struct ospf *top, struct prefix *p, unsigned int
{
int ret;
- ret = setsockopt_multicast_ipv4 (top->fd, IP_ADD_MEMBERSHIP,
- p->u.prefix4, htonl (OSPF_ALLDROUTERS),
+ ret = setsockopt_ipv4_multicast (top->fd, IP_ADD_MEMBERSHIP,
+ htonl (OSPF_ALLDROUTERS),
ifindex);
if (ret < 0)
zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
@@ -115,8 +115,8 @@ ospf_if_drop_alldrouters (struct ospf *top, struct prefix *p, unsigned int
{
int ret;
- ret = setsockopt_multicast_ipv4 (top->fd, IP_DROP_MEMBERSHIP,
- p->u.prefix4, htonl (OSPF_ALLDROUTERS),
+ ret = setsockopt_ipv4_multicast (top->fd, IP_DROP_MEMBERSHIP,
+ htonl (OSPF_ALLDROUTERS),
ifindex);
if (ret < 0)
zlog_warn ("can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %s, "
@@ -151,8 +151,7 @@ ospf_if_ipmulticast (struct ospf *top, struct prefix *p, unsigned int ifindex)
zlog_warn ("can't setsockopt IP_MULTICAST_TTL(1) for fd %d: %s",
top->fd, safe_strerror (errno));
- ret = setsockopt_multicast_ipv4 (top->fd, IP_MULTICAST_IF,
- p->u.prefix4, 0, ifindex);
+ ret = setsockopt_ipv4_multicast_if (top->fd, ifindex);
if (ret < 0)
zlog_warn("can't setsockopt IP_MULTICAST_IF(fd %d, addr %s, "
"ifindex %u): %s",