From owner-freebsd-net@FreeBSD.ORG Wed Oct 5 11:49:09 2005 Return-Path: X-Original-To: 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 4A70816A41F; Wed, 5 Oct 2005 11:49:09 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 778C743D48; Wed, 5 Oct 2005 11:49:08 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id j95Bn5Fe004979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 Oct 2005 15:49:06 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id j95Bn5Sw004978; Wed, 5 Oct 2005 15:49:05 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 5 Oct 2005 15:49:05 +0400 From: Gleb Smirnoff To: thompsa@FreeBSD.org, mlaier@FreeBSD.org Message-ID: <20051005114905.GB4291@cell.sick.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline User-Agent: Mutt/1.5.6i Cc: net@FreeBSD.org Subject: bridge and ng_ether deja vu 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: Wed, 05 Oct 2005 11:49:09 -0000 Andrew, Max, exactly after one year I see if_bridge(4) having the same problem with ng_ether(4) as old bridge(4) had. The problem is that packets flowed thru ng_ether miss bridge processing. The problem is explained well in this mail: http://lists.freebsd.org/mailman/htdig/freebsd-net/2004-May/003881.html It applies to if_bridge, too. There was two ways to fix the problem: 1) Split ether_input() into ether_input()+ether_input_frame(), like to ether_output is split. In this case ether_input() must end up with ng_ether call and ether_input_frame(). ether_input_frame() does all bridge(4) processing and calls ether_demux(). ng_ether_rcv_upper() simply calls ether_input_frame(). 2) Copy and paste the bridge processing into ng_ether_rcv_upper(). We (me, sam, andre) have choosed the second way: http://lists.freebsd.org/pipermail/cvs-src/2004-October/033496.html However, I have cut all the bridge stuff from if_ethersubr.c and moved it into bridge.c. This is how it looked like: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/net/if_ethersubr.c.diff?r1=1.178&r2=1.179&f=h Now I notice the same problem with if_bridge. And I decided to go second way again, but noticed that unfortunately I again have to copy and paste > 20 lines from if_ethersubr.c to ng_ether.c. So, the question is: is it possible to push the block about ETHER_IS_MULTICAST into bridge_input()? This will make copy and paste region smaller. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE