Subject: Re: latest ipfilter, IPv6 handling
To: Darren Reed <darrenr@reed.wattle.id.au>
From: None <itojun@iijlab.net>
List: tech-net
Date: 03/29/2001 10:22:44
>> if I were you I would put
>> #ifdef DIAGNOSTIC
>> if (MHLEN > 20 + 64)
>> panic("foo");
>> #endif
>Why is that 20 + 64 ? Isn't an IPv6 header 40 bytes long, not 64 ?
>4 + 2 + 1 + 1 + 2 * 16 = 40
you right, i made a typo. assuming that there's no tcp option,
"40 + 20" or "sizeof(struct ip6_hdr) + sizeof(struct tcphdr)".
also, the check is backwards... "MHLEN < foo".
>Should I also include:
> #ifdef DIAGNOSTIC
> if (MHLEN > 20 + 20)
> panic("foo");
> #endif
>For the plain IPv4 case ?
>I mean if we can't get a basic TCP + IPv* header into a single MBUF we're
>in a seriously screwed position and we'll be up the creek in so many ways.
for plain 4.4BSD systems MHLEN >= 20 + 64 must be true, so i don't
think we really need the above check.
NetBSD has no such limitation any more in tcp/udp input path,
we just need MHLEN > 64.
itojun