From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 10 13:30:09 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6392106564A for ; Sat, 10 Apr 2010 13:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8A44F8FC1D for ; Sat, 10 Apr 2010 13:30:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o3ADU9jC076595 for ; Sat, 10 Apr 2010 13:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o3ADU994076586; Sat, 10 Apr 2010 13:30:09 GMT (envelope-from gnats) Date: Sat, 10 Apr 2010 13:30:09 GMT Message-Id: <201004101330.o3ADU994076586@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Simpson Cc: Subject: Re: bin/111493: [patch] routed(8) doesn't use multicasts for RIPv2 via P2P interfaces X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bruce Simpson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Apr 2010 13:30:09 -0000 The following reply was made to PR bin/111493; it has been noted by GNATS. From: Bruce Simpson 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--