From owner-freebsd-net@FreeBSD.ORG Sat Oct 21 01:05:49 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 CCB5616A412; Sat, 21 Oct 2006 01:05:49 +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 184E443D58; Sat, 21 Oct 2006 01:05:44 +0000 (GMT) (envelope-from max@love2party.net) Received: from [88.64.179.70] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1Gb5Ij3t1j-0002jf; Sat, 21 Oct 2006 03:05:38 +0200 From: Max Laier Organization: FreeBSD To: freebsd-net@freebsd.org Date: Sat, 21 Oct 2006 03:07:19 +0200 User-Agent: KMail/1.9.4 References: <4539546F.6070705@elischer.org> In-Reply-To: <4539546F.6070705@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="nextPart1523085.bxqrzBJcI8"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200610210307.25911.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: andre@freebsd.org, Julian Elischer Subject: Re: PFIL hooks etc. 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:05:49 -0000 --nextPart1523085.bxqrzBJcI8 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 21 October 2006 00:57, Julian Elischer wrote: > I'm looking at some changes to the pfil and ipfw code. > > I notice that the pfil changes for link layer and bridge based > filtering have not been completed yet.. > (by which I mean that ipfw is still called directly > from those places rather than via pfil. Is anyone working on this? > I have been playing around with filtering bridges and > notice that there is no way for pfil to tell the > called modules (e.g. ipfw) that it was called from a bridge as opposed > to having been called from the ethernet framework. > > I see two possible ways this could be done. > 1/ adding a filter list head with a different KEY/KEYTYPE > for example > adding a third keytype: > > #define PFIL_TYPE_AF 1 /* key is AF_* type */ > #define PFIL_TYPE_IFNET 2 /* key is ifnet pointer */ > #define PFIL_TYPE_BRIDGE 3 /* key is ignored. Used for bridging > */ > > and making a special filter list for bridging. It would be possible > to use the ifnet associated with the bridge I guess but it would be > hard to find the right queue if you didn't know where the ifnet > for the bridge was. > > Possibly another way would be to extend the flags sent > with each packet do contain more than just the direction: > > #define PFIL_OUT 0x00000002 > #define PFIL_WAITOK 0x00000004 > #define PFIL_ALL (PFIL_IN|PFIL_OUT) > +#define PFIL_DIR (PFIL_IN|PFIL_OUT) > +#define PFIL_IPSTACK 0x00000010 > +#define PFIL_BRIDGE 0x00000020 > +#define PFIL_LINK 0x00000030 > +#define PFIL_CALLER 0x000000F0 > > > thus (flags & PFIL_CALLER) can be tested to see who called you. > and (flags & PFIL_DIR) can be tested to get the direction. > > thoughts? Andre has a WIP for this. I'll let him speak. =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 --nextPart1523085.bxqrzBJcI8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQBFOXLNXyyEoT62BG0RAnSSAJ9WwNi0SKGgHlbadCkQsAVTV0z+CgCaAmn6 fOhDjoE1ljBUVHYL13DlUFg= =F+6E -----END PGP SIGNATURE----- --nextPart1523085.bxqrzBJcI8--