From owner-freebsd-hackers Thu Jan 2 11:36:46 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id LAA26000 for hackers-outgoing; Thu, 2 Jan 1997 11:36:46 -0800 (PST) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id LAA25995 for ; Thu, 2 Jan 1997 11:36:44 -0800 (PST) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id LAA15424; Thu, 2 Jan 1997 11:36:09 -0800 (PST) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma015422; Thu Jan 2 11:36:06 1997 Received: (from archie@localhost) by bubba.whistle.com (8.7.5/8.6.12) id LAA26380; Thu, 2 Jan 1997 11:36:06 -0800 (PST) From: Archie Cobbs Message-Id: <199701021936.LAA26380@bubba.whistle.com> Subject: Re: divert code not thread/smp compatible In-Reply-To: <32C858F6.41C67EA6@whistle.com> from Julian Elischer at "Dec 30, 96 04:06:14 pm" To: julian@whistle.com (Julian Elischer) Date: Thu, 2 Jan 1997 11:36:06 -0800 (PST) Cc: proff@iq.org, hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > /* > > * ip_input() and ip_output() set this secret value before calling us to > > * let us know which divert port to divert a packet to; this is done so > > * we can use the existing prototype for struct protosw's pr_input(). > > * This is stored in host order. > > */ > > u_short ip_divert_port; > > > > /* > > * We set this value to a non-zero port number when we want the call to > > * ip_fw_chk() in ip_input() or ip_output() to ignore ``divert '' > > * chain entries. This is stored in host order. > > */ > > u_short ip_divert_ignore; > > > > Is this an acceptable trick in the FreeBSD kernel, passing parameters > > with global variables? > > > > -Julian My only excuse is that at the time I started writing the divert code, it wasn't planned on being checked in to the main branch, but instead was going to be a patch to be applied locally... so I tried to keep the patch as small as possible... and as a result committed some non-esthetically pleasing programming in the process... :-) Any suggestions on the best way to properly threadify this? Thanks, -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com