Subject: Re: Deprecated IPv6 socket options
To: None <tech-net@NetBSD.org>
From: Rui Paulo <rpaulo@gmail.com>
List: tech-net
Date: 10/28/2006 17:43:38
On Oct 28, 2006, at 12:04 AM, Christian Biere wrote:

> Hi,
>
>
> KAME has deprecated these non-standard IPv6 socket options several  
> years ago:
>
> 	IPV6_OPTIONS
> 	IPV6_RECVOPTS
> 	IPV6_RECVRETOPTS
> 	IPV6_RECVDSTADDR
> 	IPV6_RETOPTS
>
> They are still defined in sys/netinet6/in6.h although they are not  
> supported
> (anymore). They are commented out in ip6(4). Should these  
> definitions be
> removed from in6.h? Due to those, programs might assume these are  
> actually
> supported.

I think they should be commented out.

>
> 	$ grep -Erl 'IPV6_(OPTIONS|RECVOPTS|RECVRETOPTS|RECVDSTADDR| 
> RETOPTS)' .
> 	./crypto/dist/ipsec-tools/src/racoon/isakmp.c
> 	./crypto/dist/ipsec-tools/src/racoon/sockmisc.c
> 	./share/man/man4/ip6.4
> 	./sys/netinet6/in6.h
>
> The only maybe-user in NetBSD is this one:
>
> 	./crypto/dist/ipsec-tools/src/racoon/sockmisc.c
>
> Because it does this:
>
> 	#if defined(IP_RECVDSTADDR) && !defined(IPV6_RECVDSTADDR)
> 	#define IPV6_RECVDSTADDR IP_RECVDSTADDR
> 	#endif
>
> The first line should probably be changed to this:
>
> 	#if defined(IP_RECVDSTADDR) && !defined(IPV6_RECVDSTADDR) && ! 
> defined(INET6_ADVAPI)

This seems correct.

>
> This would prevent potential bugs in case the value of  
> IP_RECVDSTADDR (7) ever matches
> another option in the future.
>
> Further, attempts to use the mentioned options fail with ENOPROTOOPT:
>
>      42 ENOPROTOOPT	Protocol not available.  A bad option or level  
> was speci-
> 			fied in a getsockopt(2) or setsockopt(2) call.
>
> Shouldn't this actually be "Protocol option not available."?  
> Especially in
> the context of IPv6 claiming the "protocol" itself not being  
> available is
> rather confusing. Google shows that only HP-UX has "corrected" this  
> standard
> error message by inserting the expected "option". Would anyone mind  
> if I
> changed the string?

I think it's better to change it.

--
Rui Paulo