From owner-freebsd-net Wed Jun 19 21: 0: 6 2002 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 77BFA37B40B; Wed, 19 Jun 2002 21:00:02 -0700 (PDT) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id UAA07537; Wed, 19 Jun 2002 20:47:05 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.6/8.11.6) id g5K3kbC47150; Wed, 19 Jun 2002 20:46:37 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200206200346.g5K3kbC47150@arch20m.dellroad.org> Subject: Re: removing global variables from the network stack In-Reply-To: <20020619094420.C58636@iguana.icir.org> "from Luigi Rizzo at Jun 19, 2002 09:44:20 am" To: Luigi Rizzo Date: Wed, 19 Jun 2002 20:46:37 -0700 (PDT) Cc: julian@FreeBSD.ORG, net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Luigi Rizzo writes: > The global variable in question is "ip_divert_cookie", > declared in ip_divert.c and used to pass the divert port > to divert_packet(), and from div_output() to ip_output()/ip_input() > > For the former the fix is trivial, we just need to add an additional > argument to divert_packet(). > > For the latter, it *would* be easy to add an argument to ip_output() > but if we do not want to change the interface, perhaps the easiest > trick is to pass the annotation in the same way as it is done for > dummynet info, i.e. using a fake mbuf prepended to the actual chain. > Something like this: I don't think adding another parameter to ip_input() is such a bad thing, because presumably it would only exist in kernels with the IPDIVERT option. For "normal" people there would be no slowdown (and consequently no complaints :-) This is also simpler and faster than the aux mbuf, etc. schemes.. after all, all you are passing here is a 16 bit value. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message