Subject: Re: send-pr IPv6 patches?
To: None <tech-net@netbsd.org>
From: Feico Dillema <dillema@acm.org>
List: tech-net
Date: 12/02/1999 16:53:02
On Fri, Dec 03, 1999 at 12:19:48AM +0900, itojun@iijlab.net wrote:
> 
> 	I've cc'ed to tech-net and set a reply-to.
Just note, I'm not subscribed to tech-net, so keep cc-ing me on this
thread... Thx.

> 	For porting, please be VERY sure to use get{addr,name}info,
> 	not getipnodeby{name,addr} nor gethostbyname2.  Scoped IPv6 address
> 	(like link-local and site-local) needs to be disambiguated when
> 	your machine is on site boundary, and for that we MUST use sockaddr_in6
> 	not in6_addr (there's a big debate on ipngwg ongoing).
Yep...

> 	Basically we need to remove AF dependency from application code.

I agree that would be nice. For my syslogd-patch I do have an AF
dependency, because it simplified things quite a lot (I started out
trying to do the most portable thing with AF independent code). The
`problem' lies with the wildcard bind behaviour. Although NetBSD seems
to support IPv4 mapped addresses now on a IPv6 socket, I got in
trouble with recvfrom() giving me IPv4 addresses back instead of
IPv4-mapped ones (maybe I was doing something wrong; it was getting
late). Now, I let syslogd do a wildcard bind for AF_INET and
AF_INET6 separately and do a sendto on the one which matches the
address family of the destination. It certainly can be done in
a more AF independent manner, but I don't know how to do that really 
elegantly in this case and I couldn't find a good example elsewhere 
either.  (Most of userland uses AF_INET6 somewhere in the code). 

How important (i.e. at what price in complexity) is total AF
independence (i.e. also supporting other, future?, AF than
INET and INET6). I don't really see that in other userland
code already supporting IPv6 (like inetd, telnet and ftp).
So, instead of address *family* independence, in most cases
I'd think `mere' address *format* independence would be 
sufficient?

Feico.