2004-08-19 Paul Jakma <paul@dishone.st>
* rip_interface.c: (rip_interface_multicast_set) get rid
of extraneous if_pointopoint arg. ifp is accessible via connected.
pass connected->ifp->ifindex to setsockopt_multicast_ipv4.
* ripd.c: (rip_send_packet) update call to
rip_interface_multicast_set
* ripd.h: update rip_interface_multicast_set prototype
diff --git a/ripd/ChangeLog b/ripd/ChangeLog
index 2080333..8ab8a10 100644
--- a/ripd/ChangeLog
+++ b/ripd/ChangeLog
@@ -1,3 +1,12 @@
+2004-08-19 Paul Jakma <paul@dishone.st>
+
+ * rip_interface.c: (rip_interface_multicast_set) get rid
+ of extraneous if_pointopoint arg. ifp is accessible via connected.
+ pass connected->ifp->ifindex to setsockopt_multicast_ipv4.
+ * ripd.c: (rip_send_packet) update call to
+ rip_interface_multicast_set
+ * ripd.h: update rip_interface_multicast_set prototype
+
2004-06-11 Sowmini Varadhan <sowmini.varadhan@sun.com>
* ripd.c: (rip_distribute_update_all) distribute list hook
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 4daa5b3..cb6044e 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -138,8 +138,7 @@
}
void
-rip_interface_multicast_set (int sock, struct connected *connected,
- int if_pointopoint)
+rip_interface_multicast_set (int sock, struct connected *connected)
{
int ret;
struct servent *sp;
@@ -149,7 +148,7 @@
if (connected != NULL)
{
- if (if_pointopoint)
+ if (if_is_pointopoint(connected->ifp))
p = (struct prefix_ipv4 *) connected->destination;
else
p = (struct prefix_ipv4 *) connected->address;
@@ -160,9 +159,11 @@
addr.s_addr = INADDR_ANY;
}
- if (setsockopt_multicast_ipv4 (sock, IP_MULTICAST_IF, addr, 0, 0) < 0)
+ if (setsockopt_multicast_ipv4 (sock, IP_MULTICAST_IF, addr, 0,
+ connected->ifp->ifindex) < 0)
{
- zlog_warn ("Can't setsockopt IP_MULTICAST_IF to fd %d", sock);
+ zlog_warn ("Can't setsockopt IP_MULTICAST_IF to fd %d, ifindex %d",
+ sock, connected->ifp->ifindex);
return;
}
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 8b76073..af0e186 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -1355,7 +1355,7 @@
#ifdef RIP_RECVMSG
setsockopt_pktinfo (send_sock);
#endif /* RIP_RECVMSG */
- rip_interface_multicast_set(send_sock, connected, if_is_pointopoint(ifp));
+ rip_interface_multicast_set (send_sock, connected);
}
ret = sendto (send_sock, buf, size, 0, (struct sockaddr *)&sin,
diff --git a/ripd/ripd.h b/ripd/ripd.h
index 5c50c57..0334888 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -395,7 +395,7 @@
void rip_redistribute_withdraw (int);
void rip_zebra_ipv4_add (struct prefix_ipv4 *, struct in_addr *, u_int32_t, u_char);
void rip_zebra_ipv4_delete (struct prefix_ipv4 *, struct in_addr *, u_int32_t);
-void rip_interface_multicast_set (int, struct connected *, int);
+void rip_interface_multicast_set (int, struct connected *);
void rip_distribute_update_interface (struct interface *);
void rip_if_rmap_update_interface (struct interface *);