From owner-freebsd-net@FreeBSD.ORG Thu Jan 20 19:30:06 2005 Return-Path: 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 4260A16A4CE; Thu, 20 Jan 2005 19:30:06 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06C4E43D2F; Thu, 20 Jan 2005 19:30:06 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j0KJYYJ4030560; Thu, 20 Jan 2005 11:34:34 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j0KJYWNQ030558; Thu, 20 Jan 2005 11:34:32 -0800 Date: Thu, 20 Jan 2005 11:34:32 -0800 From: Brooks Davis To: Gleb Smirnoff Message-ID: <20050120193432.GB12156@odin.ac.hmc.edu> References: <20050117200610.GA90866@cell.sick.ru> <20050118183558.GA15150@odin.ac.hmc.edu> <41ED8D63.8090205@elischer.org> <20050119084526.GA5119@cell.sick.ru> <41EE2933.4090404@elischer.org> <20050120134553.GB18668@cell.sick.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s2ZSL+KKDSLx8OML" Content-Disposition: inline In-Reply-To: <20050120134553.GB18668@cell.sick.ru> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: Julian Elischer cc: net@freebsd.org Subject: Re: [TEST/REVIEW] ng_ipfw: node to glue together ipfw(4) and netgraph(4) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2005 19:30:06 -0000 --s2ZSL+KKDSLx8OML Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 20, 2005 at 04:45:53PM +0300, Gleb Smirnoff wrote: > Julian, >=20 > On Wed, Jan 19, 2005 at 01:32:35AM -0800, Julian Elischer wrote: > J> I'm not sure they do two different things.. Each represents a place t= o=20 > J> send packets. > J> If each active divert socket number had a pointer to the module to whi= ch it > J> was attached then you could divert to either in-kernel netgraph targe= ts or > J> to userland socket based targets. Currently of you divert to a divert > J> 'port number' and nothing is attached to it, the packet is dropped. > J> If a divert socket is attached to it, it is sent ot teh socket. > J> I would just suggest that is not a great leap of imagination that > J> attaching to a hook named 3245 would attach a netgrpah hook to the ipfw > J> code in the sam enamespace as the divert portnumber, and that a > J> subsequent attempt to attach a divert socket to that port number woild > J> fail. The packets diverted there would simply go to the netgraph hook > J> instead of going to a socket or being dropped. >=20 > Well, I've considered this. We are going to have these negatives with thi= s change: >=20 > 1) require divert loaded/compiled, when we are going to work with a compl= etely > different thing. > 2) Acquire & drop lock on divert pcb info for each packet going into netg= raph. > 3) Extensively hack divert_packet()... Let me explain. The place where we= can tell > whether we have a socket diversion or a netgraph diversion, is at the ver= y end > of divert_packet(). Before this place many things are done, which does no= t apply > to a netgraph diversion. > This hacking may bring bugs into divert infrastructure, and add extra CPU= cycles > for case of netgraph forwarding. I think saving one keyword for ipfw2 doe= sn't > worth this hacks. I think the code should be committed more or less as is. I think the netgraph and divert features are relatively orthogonal. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --s2ZSL+KKDSLx8OML Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFB8AfHXY6L6fI4GtQRApD4AJ9sfHgburFQ/DsZ4a11f+7l4utffwCfRjBJ wvjSP1I/yZk3RlduFqzE+9g= =c/vg -----END PGP SIGNATURE----- --s2ZSL+KKDSLx8OML--