From owner-freebsd-bugs@FreeBSD.ORG Sat Jul 21 14:10:05 2007 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 CDC0816A419 for ; Sat, 21 Jul 2007 14:10:05 +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 A5BB413C461 for ; Sat, 21 Jul 2007 14:10:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l6LEA5aE075121 for ; Sat, 21 Jul 2007 14:10:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l6LEA5WS075120; Sat, 21 Jul 2007 14:10:05 GMT (envelope-from gnats) Date: Sat, 21 Jul 2007 14:10:05 GMT Message-Id: <200707211410.l6LEA5WS075120@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Vernon Schryver Cc: Subject: Re: bin/111493: routed 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: Vernon Schryver List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jul 2007 14:10:05 -0000 The following reply was made to PR bin/111493; it has been noted by GNATS. From: Vernon Schryver To: dan@obluda.cz, freebsd-gnats-submit@FreeBSD.org Cc: bms@incunabulum.net, carlson@workingcode.com Subject: Re: bin/111493: routed doesn't use multicasts for RIPv2 via P2P interfaces Date: Sat, 21 Jul 2007 13:45:45 GMT I'm sending a copy of this to James Carlson, who knows a lot about the `routed` code. The description in http://www.freebsd.org/cgi/query-pr.cgi?pr=111493 says: RIPv2 should use multicasts when possible. Current code test IFF_MULTICAST on IFF_BROADCAST interfaces only. It doesn't use multicast on non-broadcast interfaces even they are multicast capable. If an interface is point-to-point (it sets the IFF_POINTOPOINT bit), is it right to send to the RIPv2 multicast address? Even on a GRE tunnel, why isn't it better to unicast to the router at the other end of the tunnel instead of multicasting? I have the impression that GRE tunnels are utterly wierd--is the remote IP address of the GRE interface not that of the remote router? I also wonder if the proposed patch does what it is intended to do. Consider the error of the missing () in the first change: @@ -140,7 +140,7 @@ flags = MSG_DONTROUTE; break; case OUT_MULTICAST: - if (ifp->int_if_flags & IFF_POINTOPOINT) { + if (ifp->int_if_flags & IFF_POINTOPOINT && ! ifp->int_if_flags & IFF_MULTICAST) { msg = "Send pt-to-pt"; C precedence rules require that expression be parsed as (!ifp->int_if_flags) & IFF_MULTICAST ifp->int_if_flags never 0, and so (!ifp->int_if_flags) is always 0 and so ((!ifp->int_if_flags) & IFF_MULTICAST) is always 0 and so the first alternative will never be taken even for ordinary, non-GRE point-to-point interfaces. I would be happier about the proposed change (with the () error fixed) if there were a test case or at least a description of the failure with the current code. Vernon Schryver vjs@rhyolite.com