Hi Stig and all: Thanks for your reply. In the meantime I found a hint of getaddinfo bug relative to the port value. It's interesting that if the port/service value passed to getaddrinfo is NULL. In this case, the ai_family value returned is good.
It seems that AIX APAR IY02197 -- a very old APAR reported against 4.3.0 -- has addressed this problem. getaddrinfo was changed to call getservbyport when a port is specified (not a service name). Thanks. Dave McLellan --Consulting Software Engineer - SPEA Engineering EMC Corporation 228 South St. Mail Stop: 228 LL/AA-24 Hopkinton, MA 01748 USA +1-508-249-1257 F: +1-508-497-8030 [EMAIL PROTECTED] -----Original Message----- From: Stig Venaas [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 13, 2005 10:07 AM To: mclellan, dave Cc: '[EMAIL PROTECTED]'; '[email protected]' Subject: Re: AIX getaddrinfo behavior On Wed, Jul 13, 2005 at 07:32:22AM -0400, mclellan, dave wrote: > Hi all: I am using getaddrinfo() on a AIX 5.1 machine. getaddrinfo() is > available on this machine, but IPv6 is not activated. when I call > getaddrinfo in order to get a sockaddr suitable for bind() with the > INADDR[6]_ANY, I'm getting odd results. > > arguments to getaddrinfo: > hostname = NULL > servname = decimal port number > hints.ai_family = AF_INET > hints.ai_protocol = 0 > hints.ai_flags = AI_PASSIVE > > getaddrinfo returns success with one sockaddr returned. However the > sa_family in the returned sockaddr specifies AF_UNSPEC, not the address > family requested. Is this a bug? based on the AIX doc I have, there is no > description of the intended behavior. Yes, this sounds like a bug. The returned address in ai_addr must be a particular family. Have you checked what ai_family in the returned addrinfo struct is? Also curious what the value of ai_addrlen and the actual address inside ai_addr is. > This same thing happens if hints.ai_family specifes AF_INET6, but I would > expect to get an error from getaddrinfo, not success with the wrong family. I agree, but again it would be interesting to check ai_family value. Stig > > I would most appreciate any advice. Thanks. > > > Dave McLellan --Consulting Software Engineer - SPEA Engineering > EMC Corporation > 228 South St. Mail Stop: 228 LL/AA-24 > Hopkinton, MA 01748 USA > +1-508-249-1257 F: +1-508-497-8030 [EMAIL PROTECTED] > > --------------------------------------------------------------------- > The IPv6 Users Mailing List > Unsubscribe by sending "unsubscribe users" to [EMAIL PROTECTED] --------------------------------------------------------------------- The IPv6 Users Mailing List Unsubscribe by sending "unsubscribe users" to [EMAIL PROTECTED]
