From owner-freebsd-net Tue Oct 15 16:22:57 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 D28B637B404 for ; Tue, 15 Oct 2002 16:22:55 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 00DA143E6A for ; Tue, 15 Oct 2002 16:22:55 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 37692 invoked by uid 1000); 15 Oct 2002 23:22:56 -0000 Date: Tue, 15 Oct 2002 16:22:56 -0700 (PDT) From: Nate Lawson To: Poul-Henning Kamp Cc: net@freebsd.org, arch@freebsd.org Subject: Re: RFC: eliminating the _IP_VHL hack. In-Reply-To: <60637.1034720233@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 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 On Wed, 16 Oct 2002, Poul-Henning Kamp wrote: > almost 7 years ago, this commit introduced the _IP_VHL hack in our > IP-stack: > > ] revision 1.7 > ] date: 1995/12/21 21:20:27; author: wollman; state: Exp; lines: +5 -1 > ] If _IP_VHL is defined, declare a single ip_vhl member in struct ip rather > ] than separate ip_v and ip_hl members. Should have no effect on current code, > ] but I'd eventually like to get rid of those obnoxious bitfields completely. > > We can argue a lot about how long time we should wait for "eventually", > but I would say that 7 years is far too long, considering the status: Fine by me. > RCS file: /home/ncvs/src/sys/netinet/ip_icmp.c,v > retrieving revision 1.70 > diff -u -r1.70 ip_icmp.c > --- ip_icmp.c 1 Aug 2002 03:53:04 -0000 1.70 > +++ ip_icmp.c 15 Oct 2002 22:05:23 -0000 > @@ -51,7 +51,6 @@ > #include > #include > > -#define _IP_VHL > #include > #include > #include > @@ -128,7 +127,7 @@ > struct ifnet *destifp; > { > register struct ip *oip = mtod(n, struct ip *), *nip; > - register unsigned oiplen = IP_VHL_HL(oip->ip_vhl) << 2; > + register unsigned oiplen = oip->ip_hl << 2; > register struct icmp *icp; > register struct mbuf *m; > unsigned icmplen; > @@ -214,7 +213,8 @@ > nip = mtod(m, struct ip *); > bcopy((caddr_t)oip, (caddr_t)nip, sizeof(struct ip)); > nip->ip_len = m->m_len; > - nip->ip_vhl = IP_VHL_BORING; > + nip->ip_v = IPVERSION; > + nip->ip_hl = 5; I think there is a manifest constant for the default ipv4 header size but can't remember it right now. -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message