Date: Wed, 19 Jun 2002 20:46:37 -0700 (PDT) From: Archie Cobbs <archie@dellroad.org> To: Luigi Rizzo <rizzo@icir.org> Cc: julian@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: removing global variables from the network stack Message-ID: <200206200346.g5K3kbC47150@arch20m.dellroad.org> In-Reply-To: <20020619094420.C58636@iguana.icir.org> "from Luigi Rizzo at Jun 19, 2002 09:44:20 am"
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206200346.g5K3kbC47150>