From owner-freebsd-net Tue Oct 15 18:22:56 2002 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 C635437B401; Tue, 15 Oct 2002 18:22:54 -0700 (PDT) Received: from mta5.snfc21.pbi.net (mta5.snfc21.pbi.net [206.13.28.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 819B643E7B; Tue, 15 Oct 2002 18:22:54 -0700 (PDT) (envelope-from hsu@FreeBSD.org) Received: from FreeBSD.org ([63.193.112.125]) by mta5.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0H41001UMVU5KX@mta5.snfc21.pbi.net>; Tue, 15 Oct 2002 18:22:54 -0700 (PDT) Date: Tue, 15 Oct 2002 18:23:22 -0700 From: Jeffrey Hsu Subject: Re: RFC: eliminating the _IP_VHL hack. In-reply-to: Message from Poul-Henning Kamp "of Wed, 16 Oct 2002 00:17:13 +0200." <60637.1034720233@critter.freebsd.dk> To: Poul-Henning Kamp Cc: net@freebsd.org, arch@freebsd.org Message-id: <0H41001UNVU5KX@mta5.snfc21.pbi.net> MIME-version: 1.0 X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT 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 > The side effect of having some source-files using the _IP_VHL hack and > some not is that sizeof(struct ip) varies from file to file, which at > best is confusing an at worst the source of some really evil bugs. > I would therefore propose to eliminate the _IP_VHL hack from the kernel > to end this state of (potential) confusion This problem could be solved more easily by changing the u_int back to an u_char, as it used to be before rev 1.15: Index: ip.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip.h,v retrieving revision 1.19 diff -u -r1.19 ip.h --- ip.h 14 Dec 2001 19:37:32 -0000 1.19 +++ ip.h 16 Oct 2002 01:15:48 -0000 @@ -51,11 +51,11 @@ u_char ip_vhl; /* version << 4 | header length >> 2 */ #else #if BYTE_ORDER == LITTLE_ENDIAN - u_int ip_hl:4, /* header length */ + u_char ip_hl:4, /* header length */ ip_v:4; /* version */ #endif #if BYTE_ORDER == BIG_ENDIAN - u_int ip_v:4, /* version */ + u_char ip_v:4, /* version */ ip_hl:4; /* header length */ #endif #endif /* not _IP_VHL */ But, if we were to pick one or the other to discard, I would keep the IP_VHL because that field really is a byte in the IP header To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message