On Sun, 24 Jun 2001 [EMAIL PROTECTED] wrote:
> >i have seen that many programmers find difficult the process of porting
> >their apps to ipv6. i think that we should write a small informational
> >document that explains how to write good ipv6-compliant code.
>
> we really need to convince random book authors to update their
> programming examples, from gethostbyname() to getnameinfo()...
how can you expect them do so, when there's so much difference between
the behaviour of the various TCP/IPv6 stacks?
HoraPe has explained us that on *BSD systems, you can have two different
sockets (one for AF_INET and one for AF_INET6) bound on the same port.
in this way you can use an af-indipendent programming style.
this is not true with linux. you have to use a single AF_INET6 socket
and listen on both incoming ipv4 and ipv6 connections.
draft-ietf-ipngwg-rfc2553bis-03.txt does not specify a specific behaviour
for bind. it's left to the implementors. i'd really like to know the
reason for doing so. IMVHO, this is a problem, because it will lead
developers to write platform-specific code and technical writers to
produce misinformation.
IMHO, draft-ietf-ipngwg-rfc2553bis-03.txt should specify what is the
correct behaviour for bind(2). i vote for the *BSD one: by having two
different sockets binding indipendently one from the other, we can
get rid of all the problems given by IPv4-mapped IPv6 address, and
have true af-indipendence. the IPV6-ONLY option and IPv4-mapped IPv6
address should not be deprecated, but their use should be unrecommended.
this policy would lead to the best result with only minor changes in the
draft and in the existing ipv6 implementations.
however, it's not so simple. in this way we have two indipendent protocol
families AF_INET and AF_INET6 (i would define them orthogonal), so
we should modify the behaviour of getaddrinfo.
in fact, when called with AI_PASSIVE flag set and AF_UNSPEC protocol
family, in a both ipv4- and ipv6-compliant system, getaddrinfo should
return two different results (::1 for ipv6 and 127.0.0.1 for ipv4).
moreover, calling getaddrinfo with AF_UNSPEC protocol family should
produce a result that's the sum of the results of two getaddrinfo
calls (one for AF_INET and one for AF_INET6).
getnameinfo does not need to be modified.
> >itojun's "Implementing AF-indipendent apps" is a very good document.
> >however, it is obsolete and it doesn't give many informations.
>
> it is a bit dated, but the content should be still valid.
> do you have any suggestions for improvements?
some code examples would be useful. the paper doesn't explain how to
handle IPv4-mapped IPv6 address and the IPV6_ONLY option, for example.
however, as you have already said, the real problem is that there is
not a "Unix Network Programming"-like reference book covering ipv6
socket programming.
--
Aequam memento rebus in arduis servare mentem...
Mauro Tortonesi [EMAIL PROTECTED]
Ferrara Linux User Group http://www.ferrara.linux.it
Project6 - IPv6 for Linux http://project6.ferrara.linux.it
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page: http://playground.sun.com/ipng
FTP archive: ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [EMAIL PROTECTED]
--------------------------------------------------------------------