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]

Reply via email to