From owner-freebsd-net Tue Oct 10 22:29:33 2000 Delivered-To: freebsd-net@freebsd.org Received: from info.iet.unipi.it (info.iet.unipi.it [131.114.9.184]) by hub.freebsd.org (Postfix) with ESMTP id AE5E137B503; Tue, 10 Oct 2000 22:29:30 -0700 (PDT) Received: (from luigi@localhost) by info.iet.unipi.it (8.9.3/8.9.3) id HAA85814; Wed, 11 Oct 2000 07:29:29 +0200 (CEST) (envelope-from luigi) From: Luigi Rizzo Message-Id: <200010110529.HAA85814@info.iet.unipi.it> Subject: Re: ip_input.c patch In-Reply-To: <200010110136.e9B1aJo40890@bubba.whistle.com> from Archie Cobbs at "Oct 10, 2000 06:36:19 pm" To: Archie Cobbs Date: Wed, 11 Oct 2000 07:29:28 +0200 (CEST) Cc: bmilekic@FreeBSD.ORG, freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Luigi Rizzo writes: > > > Does this patch look appropriate to you? > > > > wouldn't it be better to just avoid the problem in the first place > > by removing the conversion to host format and fixing the rest > > of the code to handle things in net format ? > > Sounds OK to me.. maybe some asm() guru can come up with some > fast functions for adding and subtracting byte-swapped values. don't think there is much need for that... ip_len and ip_off are mostly or probably only used in ip_input() and there you just need to fetch&swap a copy of the value into a local variable on entry and use the local variable afterwards. Even better for ip_id which is only used for equality comparisons... cheers luigi > -Archie > > ___________________________________________________________________________ > Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message