Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Apr 1996 09:53:49 -0400
From:      "Louis A. Mamakos" <louie@TransSys.COM>
To:        Jim Fleming <JimFleming@unety.net>
Cc:        "'Jordan K. Hubbard'" <jkh@time.cdrom.com>, hackers@freebsd.org
Subject:   Re: Check IP Version 
Message-ID:  <199604071353.JAA01058@whizzo.transsys.com>
In-Reply-To: Your message of "Sun, 07 Apr 1996 00:28:56 CST." <01BB2419.36344C40@webster.unety.net> 

next in thread | previous in thread | raw e-mail | index | archive | help

> 
> Jordan,
> 
> I am starting to develop a substantialliy modified version of the IP protocol.
> As specified in the IP protocol the ip_v (IP Version) field of the IP header
> should be set to 4. (see /usr/src/sys/netinet/ip.h)

IPv6 work, perhaps?

> It is not desirable for new versions of IP to "break" existing code. I have not
> provide this but in studying the SLIP code I see that there is never really
> a check done to see of the IP header is of version 4.

Just as a point of reference, the IPv6 implementation approach is to use a
different link-level discriminator to distinguish between existing IPv4 traffic
and IPv6 traffic.  It was thought that this would allow existing protocol stacks
to be more easily upgraded to accomodate IPv6, even though it may not be
strictly necessary.

That aside, you should realize that SLIP is not really suited as a multi-protocol
encapsulation, and you'll not completely solve the problem with the fix below:

> The TCP header is checked as follows...
> 
> Line 557 of /usr/src/sys/net/if_sl.c
> 
> 	if ((ip = mtod(m, struct ip *))->ip_p == IPPROTO_TCP) {
> 
> I suggest that you might want to change this to...
> 
> 	if ((ip = mtod(m, struct ip *))->ip_v == IPVERSION) && (ip->ip_p == IPPROTO_TCP)) {
> 

Consider that many folks will run CSLIP, which has very intimate
knowledge of the IP header, etc.  If you're in that boat, you've lost
whatever hope of a version number or other identifing marks.

louie




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604071353.JAA01058>