[quagga-dev 1423] Re: ripd tests for multicast flag -- is that correct?chorr at ti58: mutt -f =quagga

Andrew J. Schorr aschorr at telemetry-investments.com
Thu Aug 19 19:23:49 BST 2004


On Thu, Aug 19, 2004 at 04:28:11AM +0100, Paul Jakma wrote:
> Hmm.. I just hit this problem (I have the same address attached to 
> multiple interfaces) and came across this thread. I'm going to fix 
> ripd.c and rip_interface.c to pass the ifindex, which should cure my 
> problem..

Yes, at the time we were discussing it, I whipped up the attached patch.
I'm not sure it was ever tested, but it seems pretty trivial.

> how can we test for this behaviour though? You'd need a wee test case 
> to have autoconf compile and run to see whether setsockopt of above 
> worked.
> 
> possibly just a static OS version test would be better.

A test case seems conceptually desirable, but I'm not sure how the
test case would be able to detect the BSD kernel behavior.  So a static
OS test seems more sensible.

-Andy
-------------- next part --------------
--- ./ripd/rip_interface.c.multicast	2004-05-16 20:26:16.000000000 -0400
+++ ./ripd/rip_interface.c	2004-05-17 10:22:49.000000000 -0400
@@ -159,7 +159,8 @@
       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 ? connected->ifp->ifindex : 0)) < 0)
 	    {
 	      zlog_warn ("Can't setsockopt IP_MULTICAST_IF on fd %d to "
 	      		 "source address %s for interface %s",


More information about the Quagga-dev mailing list