[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(usagi-users 03451) getaddrinfo() returns sockaddr_in6 but machine doesn't have IPv6 turned on
- To: "'users@xxxxxxxx'" <users@xxxxxxxx>, "'usagi-users@xxxxxxxxxxxxxx'" <usagi-users@xxxxxxxxxxxxxx>
- Subject: (usagi-users 03451) getaddrinfo() returns sockaddr_in6 but machine doesn't have IPv6 turned on
- From: "mclellan, dave" <mclellan_dave@xxxxxxx>
- Date: Fri, 22 Jul 2005 15:29:02 -0400
- Reply-to: usagi-users@xxxxxxxxxxxxxx
Hi: I'm running on a Linux kernel 2.4.21-9 EL. This machine has
getaddrinfo() and I call it to get a loopback address. in the hints ai_flags
= 0, ai_protocol=0, ai_family=0. meaning I'm expecting a loopback address.
The same is designed to run on whatever is available on the machine.
I get two sockaddrs on return: a sockaddr_in6 and a sockaddr_in both of
which describe their respective loopbacks with port.
Without modifying it, I turn the sockaddr_in6 around to a socket() call.
This gets an error -- Address family not supported by protocol. Ok, I buy
that.
But why does getaddrinfo() give me and sockaddr_in6 back? IPv6 is not
turned on for the machine; shouldn't getaddrinfo() only give me a
sockaddr_in?
Thanks for any advice
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 mclellan_dave@xxxxxxx