From owner-freebsd-net@FreeBSD.ORG Sat Oct 21 01:57: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 92E2A16A494 for ; Sat, 21 Oct 2006 01:57:16 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE3C043D67 for ; Sat, 21 Oct 2006 01:57:13 +0000 (GMT) (envelope-from max@love2party.net) Received: from [88.64.179.70] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis), id 0MKwpI-1Gb66l0Yld-0004XP; Sat, 21 Oct 2006 03:57:07 +0200 From: Max Laier Organization: FreeBSD To: freebsd-net@freebsd.org Date: Sat, 21 Oct 2006 03:58:45 +0200 User-Agent: KMail/1.9.4 References: <453977CA.8020807@elischer.org> In-Reply-To: <453977CA.8020807@elischer.org> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2503953.XBPBfYAH3M"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200610210358.51403.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: Julian Elischer Subject: Re: more on pfil and bridging 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: Sat, 21 Oct 2006 01:57:16 -0000 --nextPart2503953.XBPBfYAH3M Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 21 October 2006 03:28, Julian Elischer wrote: > The more I look at this the more I think that it is broken. > > Instead of the bridge registering a separate filter queue for itself, > it is using the queues set up by the IP stack. > > It should register its own stack and each filter type should > register their own filter functions for that level on the stack. > > is there a reason that this is not done? If the answer is simply > ENOTIME then I will volunteer to go through it and do it properly. I guess so. > suggested changes: > > I propose to create filter queues for if_ethersubr.c and if_bridge.c > distinguished by slightly different keys. I also propose to rename > inet_pfil_hook to be inet_pfil_head (or inet_pfil_hooks). > > I would also look at following the documentation by seeing whether > we shouldn't be using a DLT/KEY instead of PFIL_AF and AF_INET > as the key type/key. I think if_ethersubr.c and if_bridge.c should pass to the same pfil hook. = =20 And I'd vote for the current - very sophisticated - if_bridge.c filtering=20 to stay, at least as opt-in. Otherwise it will be tricky to support=20 stateful filtering in pf on transparent bridges. > The Direction argument should be expanded to be a generic 'flags' > argument where two of the flags are direction. > Other flags can be: > WAIT_OK: (It's already defined to be there) > HOST_ORDER: Fields in the header have been swapped to host order. > > The ipfw code would supply different entry points for bridge > and Ethernet supplied packets. > > the ipfw args struct should grow a 'flags' field that can > indicate (for example) that the IP header fields have not been > put in host order (or have) and that the packet is from a bridge > rather than just being layer2. > > ipfw would grow a 'bridge' keyword to check that flag. I don't think that is necessary. Right now we also have a mode to pass=20 bridged packets as "normal" L2 packets. ipfw doesn't discriminate=20 between packets from if_ethersubr.c and if_bridge.c - and I don't see why=20 it should. If discrimination is required one can still fall back on the=20 L3decap in if_bridge.c - see above. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2503953.XBPBfYAH3M Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBFOX7bXyyEoT62BG0RAq4ZAJ9M4R3acqj1oPTUwQ3/KIr9qf1ZfACeINM8 Apx/qC1ZwJHrk+QuNj1fJYI= =dWYb -----END PGP SIGNATURE----- --nextPart2503953.XBPBfYAH3M--