atom feed9 messages in org.freebsd.freebsd-archRe: RFC: eliminating the _IP_VHL hack.
FromSent OnAttachments
Poul-Henning KampOct 15, 2002 3:16 pm 
Luigi RizzoOct 15, 2002 3:26 pm 
Garrett WollmanOct 15, 2002 3:46 pm 
Nate LawsonOct 15, 2002 4:22 pm 
Jeffrey HsuOct 15, 2002 6:23 pm 
Poul-Henning KampOct 15, 2002 11:39 pm 
Bruce EvansOct 16, 2002 1:03 am 
Poul-Henning KampOct 16, 2002 1:16 am 
Bruce EvansOct 16, 2002 8:02 am 
Subject:Re: RFC: eliminating the _IP_VHL hack.
From:Nate Lawson (na@root.org)
Date:Oct 15, 2002 4:22:34 pm
List:org.freebsd.freebsd-arch

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 majo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message