From owner-freebsd-bugs@FreeBSD.ORG Wed Apr 11 23:10:02 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18BEB16A400 for ; Wed, 11 Apr 2007 23:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id EE60913C457 for ; Wed, 11 Apr 2007 23:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l3BNA1f7017179 for ; Wed, 11 Apr 2007 23:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l3BNA1qQ017178; Wed, 11 Apr 2007 23:10:01 GMT (envelope-from gnats) Resent-Date: Wed, 11 Apr 2007 23:10:01 GMT Resent-Message-Id: <200704112310.l3BNA1qQ017178@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Lukes Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D624616A400 for ; Wed, 11 Apr 2007 23:03:09 +0000 (UTC) (envelope-from dan@kulesh.obluda.cz) Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz [195.113.24.4]) by mx1.freebsd.org (Postfix) with ESMTP id 65EF713C4B8 for ; Wed, 11 Apr 2007 23:03:08 +0000 (UTC) (envelope-from dan@kulesh.obluda.cz) Received: from kulesh.obluda.cz (openvpn.ms.mff.cuni.cz [195.113.20.87]) by smtp1.kolej.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l3BN35pC069775 for ; Thu, 12 Apr 2007 01:03:07 +0200 (CEST) (envelope-from dan@kulesh.obluda.cz) Received: from kulesh.obluda.cz (localhost. [127.0.0.1]) by kulesh.obluda.cz (8.13.8/8.13.8) with ESMTP id l3BN34Ts051685 for ; Thu, 12 Apr 2007 01:03:04 +0200 (CEST) (envelope-from dan@kulesh.obluda.cz) Received: (from root@localhost) by kulesh.obluda.cz (8.13.8/8.13.8/Submit) id l3BN34fm051684; Thu, 12 Apr 2007 01:03:04 +0200 (CEST) (envelope-from dan) Message-Id: <200704112303.l3BN34fm051684@kulesh.obluda.cz> Date: Thu, 12 Apr 2007 01:03:04 +0200 (CEST) From: Dan Lukes To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/111493: [ PATCH ] 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: Dan Lukes List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2007 23:10:02 -0000 >Number: 111493 >Category: bin >Synopsis: [ PATCH ] routed doesn't use multicasts for RIPv2 via P2P interfaces >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Apr 11 23:10:00 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Dan Lukes >Release: FreeBSD 6.2-STABLE i386 >Organization: Obludarium >Environment: System: FreeBSD 6.2-STABLE src/sbin/routed/output.c,v 1.12 2005/05/31 20:28:48 >Description: 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. >How-To-Repeat: Configure RIPv2 on a multicast capable point to point link (GRE or so), use tcpdump to see packets >Fix: Honor the IFF_MULTICAST on IFF_POINTOPOINT interfaces also. P2P logic follow the ethernet logic - multicasts are not used when: 1. P2P interface is not multicast capable 2. RIPv1 compatibility requested 3. disabled by configuration (no_rip_mcast configuration directive - note, it's not new directive created by patch, it exist already) --- patch-sbin-routed-output.c begins here --- --- sbin/routed/output.c.ORIG Tue May 31 22:28:48 2005 +++ sbin/routed/output.c Wed Apr 11 22:26:59 2007 @@ -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"; } else if (ifp->int_state & IS_DUP) { trace_act("abort multicast output via %s" @@ -874,7 +874,13 @@ } else if (ifp->int_if_flags & IFF_POINTOPOINT) { /* point-to-point hardware interface */ dst.sin_addr.s_addr = ifp->int_dstaddr; - type = OUT_UNICAST; + + if (vers == RIPv2 + && !(ifp->int_state & IS_NO_RIP_MCAST)) { + type = OUT_MULTICAST; + } else { + type = OUT_UNICAST; + } } else if (ifp->int_state & IS_REMOTE) { /* remote interface */ @@ -963,7 +969,17 @@ } else if (ifp->int_if_flags & IFF_POINTOPOINT) { /* point-to-point hardware interface */ dst.sin_addr.s_addr = ifp->int_dstaddr; - type = OUT_UNICAST; + + /* Broadcast RIPv1 queries and RIPv2 queries + * when the hardware cannot multicast. + */ + 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 */ --- patch-DAN-routed-output.c ends here --- >Release-Note: >Audit-Trail: >Unformatted: