Subject: getaddrinfo

From: Mauro Tortonesi <[email-masked]>
Date: Tue, 12 Sep 2000 11:27:30 +0200 (CEST)

hi,

i have a question about the getaddrinfo function. 

first, suppose that the nodename argument is a numeric host address and
the flag AI_NUMERICHOST is not set. will the query to getaddrinfo return
ALL addresses of that host? 

IMHO it should, but draft-...-rfc2553bis-00 is not very clear about this.
it only states that AI_NUMERICHOST prevents the DNS from being invoked, so
i guess that if AI_NUMERICHOST is not set, then a query to the resolution
service MUST be made, even if nodename is a numeric host address. 

there is also one more problem i'd like to talk about. in order to have a
stable and standard api, rfc2553bis and XNET specifications should not be
contradictory. i know at least one big implementation that is unwilling
to support rfc2553bis because it does not follow XNET specs. this is a
serious problem IMO. 

-- 
Aequam memento rebus in arduis servare mentem...

Mauro Tortonesi			[email-masked]
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-masked]
--------------------------------------------------------------------

---

From: Jim Bound <[email-masked]>
Date: Fri, 15 Sep 2000 13:04:26 -0400

Hi Maruo,

>ALL addresses of that host? 

No.  That is an error and you will get EAI_AGAIN is my view.  

>service MUST be made, even if nodename is a numeric host address. 

Correct.

>to support rfc2553bis because it does not follow XNET specs. this is a

I agree.  We have an offline design team of folks who are talking and we
are about ready to report our findings.

A bit of history here.  The only purpose of the base API since the
beginning was to add the basic syntax and semantics to add IPv6 to the
BSD sockets programming model.  But two things happened.  Creeping
featurism and we need to support scopes for addresses.  This lead us to
add the getaddrinfo and friends API and now we have deprecated
getipnodebyname and friends.  

The next revision of 2553bis will fix some base IPv6 issues and provide
one new feature to tell an implementation to not process IPv4 Mapped
addresses which came into the implementation as native IPv4 addresses at
the Stevens and BSD ip_input.c module.  Also provide additional clarity.

The getaddrinfo and friends API has numerous combinations and a complex
matrice of choices for the variant parameters to these new APIs.  All we
are specifying in the Base API (2553bis) are when specific IPv6 datums
created by the Base API are used in these new APIs.  For example what
happens when AI_V4MAPPED is set, or what is in the sin6_scope_id field.

But the many questions like yours above really are generic to these new
APIs and not specific for IPv6.

To that end the Base API will not specify or try to annotate all
behaviors of these new APIs (new in the sense of adoption by 
2553bis).  

We will point this work to the XNET group to the IEEE POSIX 1003
committee who will own this API.  This is not the job of the IPng WG as
our job is to get the IPv6 parameters defined.  

After the next release of 2553bis (and in the next release) the WG and
community will be given a pointer to how to participate with XNET to
work on the issues as you have just presented.  I will work with Andrew
Gollan from Sun to make this as clear as possible for you all.

So to answer your question the next version of 2553bis for getaddrinfo
and friends will duplicate the present wording of XNET except where 
we need to add any new features from IPng WG discussion.  But we will
not try to solve or specify all the needed behavior of getaddrinfo and
friends thats XNET's job.

This is one of the reasons I wish we had been able to keep the simple
getipnodebyname and friends working with scopes, but we can't and need
to move on.

regards,
/jim

---

From: Mauro Tortonesi <[email-masked]>
Date: Mon, 18 Sep 2000 10:43:57 +0200 (CEST)

On Fri, 15 Sep 2000, Jim Bound wrote:

> Hi Mauro,

maybe i have not explained the situation very well. the call:

getaddrinfo("xxx:xxx::xxx", NULL, &res)

should return the full results of a query to the DNS for address "xxx...",
and not only a struct sockaddr_in6 filled with the address "xxx...", imo.
is this correct?

> >service MUST be made, even if nodename is a numeric host address. 

thank you for your answers.

---

From: Jim Bound <[email-masked]>
Date: Mon, 18 Sep 2000 20:14:40 -0400

Mauro,

>and not only a struct sockaddr_in6 filled with the address "xxx...", imo.

Yes.  

regards,
/jim

---

From: Hideaki YOSHIFUJI (吉藤英明) <[email-masked]>
Date: Tue, 19 Sep 2000 09:33:06 +0900

> >and not only a struct sockaddr_in6 filled with the address "xxx...", imo.

What do you mean by "full results," Mauro?

> Yes.  

Really?

-- 
Hideaki YOSHIFUJI @ USAGI Project  <[email-masked]>
Web Page: http://www.ecei.tohoku.ac.jp/%7Eyoshfuji/
PGP5i FP: F731 6599 5EB2 BBA7 1515  1323 1806 A96F 5700 6B25 
--------------------------------------------------------------------
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-masked]
--------------------------------------------------------------------

---

From: Mauro Tortonesi <[email-masked]>
Date: Tue, 19 Sep 2000 18:59:29 +0200 (CEST)

> What do you mean by "full results," Mauro?

simply the result of a query to the dns ;)

---

From: Hideaki YOSHIFUJI (吉藤英明) <[email-masked]>
Date: Wed, 20 Sep 2000 02:41:20 +0900

> simply the result of a query to the dns ;) 

For what?
You should show us FULL example code and result; don't try to describe.

---

From: Mauro Tortonesi <[email-masked]>
Date: Wed, 20 Sep 2000 10:59:08 +0200 (CEST)

> You should show us FULL example code and result; don't try to describe.

source code is not very significant. it simply contains the call:

        memset(&ai, 0, sizeof(ai));
        ai.ai_family = AF_UNSPEC;
        ai.ai_protocol = IPPROTO_TCP;  
        ai.ai_flags = AI_CANONNAME;  	

	if ((err = getaddrinfo(host,"finger", &ai, &res)) != 0 || !res) {
		eprintf("finger: getaddrinfo failure: %s\n",
			gai_strerror(err));
		return;
	}

where host is "fe80::248:54ff:fe4b:1c6f". the results are:

res dumped:

flags: AI_CANONNAME AI_ALL 
family: AF_INET6 
socket type: SOCK_STREAM
protocol: 6 
ip address length: 24 
canonic name: trantorv6 

res->ai_addr dumped:

family: AF_INET6
port: 79
address: fe80::248:54ff:fe4b:1c6f

no query to the dns is done. 

--

Mauro Tortonesi