Date: Sat, 10 Apr 2010 13:30:09 GMT From: Bruce Simpson <bms@incunabulum.net> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/111493: [patch] routed(8) doesn't use multicasts for RIPv2 via P2P interfaces Message-ID: <201004101330.o3ADU994076586@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/111493; it has been noted by GNATS. From: Bruce Simpson <bms@incunabulum.net> To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: bin/111493: [patch] routed(8) doesn't use multicasts for RIPv2 via P2P interfaces Date: Sat, 10 Apr 2010 14:27:00 +0100 This is a multi-part message in MIME format. --------------090908040401060704000003 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Pulled up proposed patch on HEAD. FreeBSD's routed has deviated from vendor branch too much, and the vendor branch history got lost in the noise of the SVN conversion. --------------090908040401060704000003 Content-Type: text/plain; name="routed-gre.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="routed-gre.diff" diff -uNr -x '.svn*' -x 'Makefile*' -x md5.c routed/output.c routedx/output.c --- routed/output.c 2010-04-10 14:21:52.000000000 +0100 +++ routedx/output.c 2007-08-13 16:33:55.000000000 +0100 @@ -140,8 +142,8 @@ flags = MSG_DONTROUTE; break; case OUT_MULTICAST: - if ((ifp->int_if_flags & (IFF_POINTOPOINT|IFF_MULTICAST)) == - IFF_POINTOPOINT) { + if ((ifp->int_if_flags & IFF_POINTOPOINT) + && !(ifp->int_if_flags & IFF_MULTICAST)) { msg = "Send pt-to-pt"; } else if (ifp->int_state & IS_DUP) { trace_act("abort multicast output via %s" @@ -862,9 +877,10 @@ } else if (ifp->int_if_flags & IFF_POINTOPOINT) { /* point-to-point hardware interface */ dst.sin_addr.s_addr = ifp->int_dstaddr; - if (vers == RIPv2 && - ifp->int_if_flags & IFF_MULTICAST && - !(ifp->int_state & IS_NO_RIP_MCAST)) { + /* use multicast if the interface allows (e.g. GRE) */ + if (vers == RIPv2 + && (ifp->int_if_flags & IFF_MULTICAST) + && !(ifp->int_state & IS_NO_RIP_MCAST)) { type = OUT_MULTICAST; } else { type = OUT_UNICAST; @@ -957,7 +973,14 @@ } else if (ifp->int_if_flags & IFF_POINTOPOINT) { /* point-to-point hardware interface */ dst.sin_addr.s_addr = ifp->int_dstaddr; - type = OUT_UNICAST; + /* use multicast if the interface allows (e.g. GRE) */ + if (buf.rip_vers == RIPv2 + && (ifp->int_if_flags & IFF_MULTICAST) + && !(ifp->int_state & IS_NO_RIP_MCAST)) { + type = OUT_MULTICAST; + } else { + type = OUT_UNICAST; + } } else if (ifp->int_state & IS_REMOTE) { /* remote interface */ --------------090908040401060704000003--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004101330.o3ADU994076586>