Well, see this IPv4-only setup, and getaddrinfo() returning both IPv4 and IPv6:
Code: Select all
pi@raspberrypi ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:96:c4:2f
inet addr:192.168.1.55 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:86 errors:0 dropped:0 overruns:0 frame:0
TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9049 (8.8 KiB) TX bytes:13562 (13.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
pi@raspberrypi ~ $
pi@raspberrypi ~ $ python
Python 2.7.3rc2 (default, May 6 2012, 20:02:25)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> print socket.getaddrinfo("news.onsnet.nu", 119, 0, socket.SOCK_STREAM)
[(2, 1, 6, '', ('195.200.85.11', 119)), (2, 1, 6, '', ('195.200.85.12', 119)), (10, 1, 6, '', ('2a01:788:2:1::c013:1', 119, 0, 0)), (10, 1, 6, '', ('2a01:788:2:1::c013:2', 119, 0, 0))]
>>>
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
pi@raspberrypi ~ $
EDIT:
On this IPv4 only setup:
newszilla6.xs4all.nl (ipv6 only) results in "[Errno 97] Address family not supported by protocol", which is correct.
news.onsnet.nu results in "Timed out", so apparantly on my setup SAB first uses the IPv4 address