From owner-freebsd-net@FreeBSD.ORG Tue Mar 7 02:54:16 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2CA0416A420 for ; Tue, 7 Mar 2006 02:54:16 +0000 (GMT) (envelope-from thompsa@freebsd.org) Received: from dbmail-mx1.orcon.net.nz (loadbalancer1.orcon.net.nz [219.88.242.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 864CE43D46 for ; Tue, 7 Mar 2006 02:54:15 +0000 (GMT) (envelope-from thompsa@freebsd.org) Received-SPF: none Received: from heff.fud.org.nz (60-234-149-201.bitstream.orcon.net.nz [60.234.149.201]) by dbmail-mx1.orcon.net.nz (8.13.2/8.13.2/Debian-1) with SMTP id k272sfeY003455; Tue, 7 Mar 2006 15:54:41 +1300 Received: by heff.fud.org.nz (Postfix, from userid 1001) id 0FEE71CCC1; Tue, 7 Mar 2006 15:54:11 +1300 (NZDT) Date: Tue, 7 Mar 2006 15:54:10 +1300 From: Andrew Thompson To: Nik Lam Message-ID: <20060307025410.GA55053@heff.fud.org.nz> References: <440CEBDE.5090602@j2d.lam.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <440CEBDE.5090602@j2d.lam.net.au> User-Agent: Mutt/1.5.11 X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on dbmail-mx1.orcon.net.nz X-Virus-Status: Clean Cc: freebsd-net@freebsd.org Subject: Re: if_bridge steals IP address of non-member interface X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2006 02:54:16 -0000 On Tue, Mar 07, 2006 at 01:11:42PM +1100, Nik Lam wrote: > I'm not sure if what I'm seeing is an artefact of me doing something > unusual with my design or if there is a bug in if_bridge. > > I'm dividing my LAN into two parts using a pair of intel pro 1000 (em) > interfaces in an if_bridge bridge. I've configured this bridge with STP > (802.1d) although I don't think this should be the cause of the > problem. On the same host which is doing the bridging, I've got another > interface (fxp0) which is configured "normally", i.e. it has an IP > address on the subnet which the bridge divides. > > Generally this setup works fine, however every now and then I find that > the bridge is answering ARP who-has queries for the IP address assigned > to fxp0. Can you try this patch. cheers, Andrew Index: if_ether.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/if_ether.c,v retrieving revision 1.150 diff -u -p -r1.150 if_ether.c --- if_ether.c 31 Jan 2006 21:29:41 -0000 1.150 +++ if_ether.c 7 Mar 2006 02:52:42 -0000 @@ -631,7 +631,7 @@ in_arpinput(m) * XXX: This is really ugly! */ LIST_FOREACH(ia, INADDR_HASH(itaddr.s_addr), ia_hash) { - if (((bridged && ia->ia_ifp->if_type != IFT_BRIDGE) || + if (((bridged && ia->ia_ifp->if_bridge != NULL) || (ia->ia_ifp == ifp)) && itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) goto match; @@ -645,7 +645,7 @@ in_arpinput(m) #endif } LIST_FOREACH(ia, INADDR_HASH(isaddr.s_addr), ia_hash) - if (((bridged && ia->ia_ifp->if_type != IFT_BRIDGE) || + if (((bridged && ia->ia_ifp->if_bridge != NULL) || (ia->ia_ifp == ifp)) && isaddr.s_addr == ia->ia_addr.sin_addr.s_addr) goto match;