Dear Jason, Il 04/11/2011 02:27, Jason Tackaberry ha scritto: > > kaa.Socket uses AF_INET6 sockets exclusively, and uses IPv4-mapped > IPv6 addresses for IPv4 addresses on AF_INET6 sockets. This is why > you see: > > $ netstat --inet6 -an | grep 19999 > tcp6 0 0 127.0.0.1:19999 :::* > LISTEN > > That's expected; netstat is just showing the IPv4-mapped address > (::ffff:127.0.0.1) stripped of the prefix. These sockets can be > connected over IPv4. >
for the record, I logged into my freevo-box (that runs Debian/squeeze/i386) and I did some tests using the utility 'netcat6' (version 1.0-8 ), namely, I started $ nc6 -l -p 19089 on one console, and then I checked that # netstat --inet6 -a | grep 19089 tcp6 0 0 [::]:19089 [::]:* LISTEN # netstat --inet -a | grep 19089 tcp 0 0 *:19089 *:* LISTEN as you see this is quite different than what kaa does, indeed when kaa listens on a socket, that port appears only in the 'netstat --inet6 -a' listing I also tested that I can send data to the 'nc6' that is listening to that port 19089, both using 'nc' and using 'nc6' ; and I can send data to that host from a different host (only ipv4 since my home network is not ipv6) So somehow 'netcat6' manages to do the right thing even inside my freevo-box > Getting a /network/ unreachable when you try to connect to 127.0.0.1 > is perplexing. My first instinct was that lo was down, but your ip > addr ls output says otherwise. > > Doing a bit of Googling, I see that the BSDs don't support IPv4-mapped > addresses on IPv6 sockets. This might be a reason to change > kaa.Socket to use AF_INET or AF_INET6 sockets selectively. Are you > using a BSD kernel on Debian? nope, standard linux 2.6.32-5-686 > Can you please try the attached crudely constructed test script and > dump the output? Make sure ::1 isn't in the localhost address list in > /etc/hosts. > I tried your script in four PCs (all running different installs of Debian), and my freevo-box is the only one where it fails (!!) and I then tried to understand what is the difference but I really could not spot anything that may explain this weird fact. (I even tried to 'diff' the whole /etc/ tree of the freevo-box against another PC, but I did not spot anything suspicious) To prepare the files in attachment I used this shell line # ( uname -r ; uname -m ; echo ; ip addr ls ; echo ; ip ro ls ; echo ; ip -6 ro ls ; echo ; dpkg -l libc6 python ; echo ; python sockettest.py ) See attachment. > Thanks! > thank you for the effort a.
2.6.32-5-amd64
x86_64
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state
UNKNOWN qlen 1000
link/ether 00:1b:fc:ed:7d:65 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.21/24 brd 192.168.0.255 scope global eth0
inet6 fe80::21b:fcff:feed:7d65/64 scope link
valid_lft forever preferred_lft forever
3: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
link/ether a2:51:0b:d4:68:10 brd ff:ff:ff:ff:ff:ff
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.21
default via 192.168.0.1 dev eth0
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit
4294967295
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Nome Versione
Descrizione
+++-============================================-====================================-==============================================================================
ii libc6 2.11.2-10
Embedded GNU C Library: Shared libraries
ii python 2.6.6-3+squeeze6
interactive high-level object-oriented language (default version)
------ localhost
AF_INET bind to localhost:20011
try ('127.0.0.1', 20011)
AF_INET bind to localhost:20011
try ('127.0.0.1', 20011)
AF_INET connect to localhost:20011
try ('127.0.0.1', 20011)
------ 127.0.0.1
AF_INET bind to 127.0.0.1:20011
try ('127.0.0.1', 20011)
AF_INET bind to 127.0.0.1:20011
try ('127.0.0.1', 20011)
AF_INET connect to 127.0.0.1:20011
try ('127.0.0.1', 20011)
------ localhost
AF_INET6 bind to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
AF_INET6 bind to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
AF_INET6 connect to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
------ ip6-localhost
AF_INET6 bind to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 bind to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 connect to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
------ 127.0.0.1
AF_INET6 bind to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
AF_INET6 bind to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
AF_INET6 connect to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
------ ::1
AF_INET6 bind to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 bind to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 connect to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
2.6.32-5-openvz-amd64
x86_64
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
qlen 1000
link/ether 00:1f:c6:a1:81:61 brd ff:ff:ff:ff:ff:ff
inet6 fe80::21f:c6ff:fea1:8161/64 scope link
valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 00:18:51:a6:de:5f brd ff:ff:ff:ff:ff:ff
inet 192.84.155.215/24 brd 192.84.155.255 scope global br0
inet6 fe80::21f:c6ff:fea1:8161/64 scope link
valid_lft forever preferred_lft forever
4: br1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 00:38:fe:b7:73:58 brd ff:ff:ff:ff:ff:ff
inet 10.0.1.1/24 brd 10.0.1.255 scope global br1
inet6 fe80::b0f8:efff:fe0a:64ab/64 scope link
valid_lft forever preferred_lft forever
5: br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 00:28:51:64:c3:7b brd ff:ff:ff:ff:ff:ff
inet 10.0.2.1/24 brd 10.0.2.255 scope global br2
inet6 fe80::40e9:b3ff:fea6:4591/64 scope link
valid_lft forever preferred_lft forever
6: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue
state UNKNOWN
link/void
7: veth100.3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UNKNOWN
link/ether 00:38:fe:b7:73:58 brd ff:ff:ff:ff:ff:ff
inet6 fe80::238:feff:feb7:7358/64 scope link
valid_lft forever preferred_lft forever
8: veth100.4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UNKNOWN
link/ether 00:28:51:64:c3:7b brd ff:ff:ff:ff:ff:ff
inet6 fe80::228:51ff:fe64:c37b/64 scope link
valid_lft forever preferred_lft forever
9: veth111.7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UNKNOWN
link/ether 00:48:51:77:37:58 brd ff:ff:ff:ff:ff:ff
inet6 fe80::248:51ff:fe77:3758/64 scope link
valid_lft forever preferred_lft forever
10: veth111.8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
UNKNOWN
link/ether 00:18:51:a6:de:5f brd ff:ff:ff:ff:ff:ff
inet6 fe80::218:51ff:fea6:de5f/64 scope link
valid_lft forever preferred_lft forever
10.0.1.0/24 dev br1 proto kernel scope link src 10.0.1.1
10.0.2.0/24 dev br2 proto kernel scope link src 10.0.2.1
192.84.155.0/24 dev br0 proto kernel scope link src 192.84.155.215
default via 192.84.155.1 dev br0
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit
4294967295
fe80::/64 dev br0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit
4294967295
fe80::/64 dev br1 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit
4294967295
fe80::/64 dev br2 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit
4294967295
fe80::/64 dev veth100.3 proto kernel metric 256 mtu 1500 advmss 1440
hoplimit 4294967295
fe80::/64 dev veth100.4 proto kernel metric 256 mtu 1500 advmss 1440
hoplimit 4294967295
fe80::/64 dev veth111.7 proto kernel metric 256 mtu 1500 advmss 1440
hoplimit 4294967295
fe80::/64 dev veth111.8 proto kernel metric 256 mtu 1500 advmss 1440
hoplimit 4294967295
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Nome Versione
Descrizione
+++-==========================================-===============================================-=====================================================================================================================================================================================================================
ii libc6 2.11.2-10
Embedded GNU C Library: Shared libraries
ii python 2.6.6-3+squeeze6
interactive high-level object-oriented language (default version)
------ localhost
AF_INET bind to localhost:20011
try ('127.0.0.1', 20011)
AF_INET bind to localhost:20011
try ('127.0.0.1', 20011)
AF_INET connect to localhost:20011
try ('127.0.0.1', 20011)
------ 127.0.0.1
AF_INET bind to 127.0.0.1:20011
try ('127.0.0.1', 20011)
AF_INET bind to 127.0.0.1:20011
try ('127.0.0.1', 20011)
AF_INET connect to 127.0.0.1:20011
try ('127.0.0.1', 20011)
------ localhost
AF_INET6 bind to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
AF_INET6 bind to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
AF_INET6 connect to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
------ ip6-localhost
AF_INET6 bind to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 bind to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 connect to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
------ 127.0.0.1
AF_INET6 bind to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
AF_INET6 bind to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
AF_INET6 connect to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
------ ::1
AF_INET6 bind to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 bind to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 connect to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
3.0.0-1-amd64
x86_64
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
qlen 1000
link/ether 00:25:00:ad:af:da brd ff:ff:ff:ff:ff:ff
inet 192.168.0.100/24 brd 192.168.0.255 scope global eth0
inet6 fe80::225:ff:fead:afda/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:25:00:3f:42:ab brd ff:ff:ff:ff:ff:ff
default via 192.168.0.1 dev eth0 proto static
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.100 metric 1
fe80::/64 dev eth0 proto kernel metric 256
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Nome Versione
Descrizione
+++-====================================-=================================-==========================================================================
ii libc6 2.13-21
Embedded GNU C Library: Shared libraries
ii python 2.7.2-9
interactive high-level object-oriented language (default version)
------ localhost
AF_INET bind to localhost:20011
try ('127.0.0.1', 20011)
AF_INET bind to localhost:20011
try ('127.0.0.1', 20011)
AF_INET connect to localhost:20011
try ('127.0.0.1', 20011)
------ 127.0.0.1
AF_INET bind to 127.0.0.1:20011
try ('127.0.0.1', 20011)
AF_INET bind to 127.0.0.1:20011
try ('127.0.0.1', 20011)
AF_INET connect to 127.0.0.1:20011
try ('127.0.0.1', 20011)
------ localhost
AF_INET6 bind to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
AF_INET6 bind to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
AF_INET6 connect to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
------ ip6-localhost
AF_INET6 bind to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 bind to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 connect to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
------ 127.0.0.1
AF_INET6 bind to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
AF_INET6 bind to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
AF_INET6 connect to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
------ ::1
AF_INET6 bind to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 bind to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 connect to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
2.6.32-5-686
i686
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
qlen 1000
link/ether 90:e6:ba:70:a8:3c brd ff:ff:ff:ff:ff:ff
inet 192.168.0.23/24 brd 192.168.0.255 scope global eth0
inet6 fe80::92e6:baff:fe70:a83c/64 scope link
valid_lft forever preferred_lft forever
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.23
default via 192.168.0.1 dev eth0
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Nome Versione
Descrizione
+++-=============================================-=============================-=============================================================================
ii libc6 2.11.2-10
Embedded GNU C Library: Shared libraries
ii python 2.6.6-3+squeeze6
interactive high-level object-oriented language (default version)
------ localhost
AF_INET bind to localhost:20011
try ('127.0.0.1', 20011)
AF_INET bind to localhost:20011
try ('127.0.0.1', 20011)
AF_INET connect to localhost:20011
try ('127.0.0.1', 20011)
------ 127.0.0.1
AF_INET bind to 127.0.0.1:20011
try ('127.0.0.1', 20011)
AF_INET bind to 127.0.0.1:20011
try ('127.0.0.1', 20011)
AF_INET connect to 127.0.0.1:20011
try ('127.0.0.1', 20011)
------ localhost
AF_INET6 bind to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
-> failed: [Errno 22] Invalid argument
AF_INET6 bind to localhost:20011
try ('127.0.0.1', 20011) -> ('::ffff:127.0.0.1', 20011)
-> failed: [Errno 22] Invalid argument
skipping connect
------ ip6-localhost
AF_INET6 bind to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 bind to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 connect to ip6-localhost:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
------ 127.0.0.1
AF_INET6 bind to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
-> failed: [Errno 22] Invalid argument
AF_INET6 bind to 127.0.0.1:20011
try ('::ffff:127.0.0.1', 20011, 0, 0) -> ('::ffff:127.0.0.1', 20011, 0, 0)
-> failed: [Errno 22] Invalid argument
skipping connect
------ ::1
AF_INET6 bind to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 bind to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
AF_INET6 connect to ::1:20011
try ('::1', 20011, 0, 0) -> ('::1', 20011, 0, 0)
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________ Freevo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-devel
