views:

384

answers:

3

I'm using getaddrinfo() to return all assigned IP addresses (both IPv4 and IPv6) for my local machine. I see that on XP, getaddrinfo() only returns ::1

( I installed the IPV6 stack on 2 XP machine and configured the IPV6 address and pinged the both peers. they are working fine. I check the Ipconfig its all working fine. )

+3  A: 

I believe that Gonzalo is on the right track. ::1 is a shorthand for localhost from what I understand . . . In just about every case the IPV6 localhost ::1 shows up first when iterating through the returned list . . .

TheEruditeTroglodyte
Nitpick: not a shorthand. ::1 is the local address. Names are something different. (On Debian, the default name for this address is ip6-localhost.)
bortzmeyer
A: 

Well, in the ::1 address (or, rather, in any address, that has a double colon in it) double colon expands into the number of zero-bits, neccessary to pad the address to full length, so the expanded version looks like 0000:0000:0000:0000:0000:0000:0000:0001.

In ipv6 this is the only address, that is specifically defined as a loopback address (unlike ipv4, where you get 127.0.0.0/8 for those purposes).

(Are you sure, that you are actually iterating over the result and not just checking the first element of the linked list?)

shylent
A: 

I'd advise to stay away from the dual stack configurations on Windows XP and 2003. The stacks just don't play nice with each other. If you want IPv6 use Windows 2008 R2 or Windows 7.

MK