Date: Tue, 15 Oct 2002 16:22:56 -0700 (PDT) From: Nate Lawson <nate@root.org> To: Poul-Henning Kamp <phk@freebsd.org> Cc: net@freebsd.org, arch@freebsd.org Subject: Re: RFC: eliminating the _IP_VHL hack. Message-ID: <Pine.BSF.4.21.0210151614240.37181-100000@root.org> In-Reply-To: <60637.1034720233@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <net/if_types.h> > #include <net/route.h> > > -#define _IP_VHL > #include <netinet/in.h> > #include <netinet/in_systm.h> > #include <netinet/in_var.h> > @@ -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-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0210151614240.37181-100000>