[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: connect() with AF_INET6 freezes on some Debian/unstable machine



 Hi.

On Tue, Apr 07, 2015 at 12:42:18PM +0200, Vincent Lefevre wrote:
> On a Debian/stable machine:
> 
> cassis:~> strace -o str.out telnet -6 www.vinc17.net 80
> Trying 2001:4b98:dc0:45:216:3eff:fe9b:eb2f...
> telnet: Unable to connect to remote host: Network is unreachable
> zsh: exit 1     strace -o str.out telnet -6 www.vinc17.net 80
> 
> which is OK since IPv6 doesn't work here, and str.out contains:
> 
> [...]
> socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 3
> setsockopt(3, SOL_IP, IP_TOS, [16], 4)  = 0
> connect(3, {sa_family=AF_INET6, sin6_port=htons(80), inet_pton(AF_INET6, "2001:4b98:dc0:45:216:3eff:fe9b:eb2f", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 ENETUNREACH (Network is unreachable)
> [...]
> 
> But on my Debian/unstable machine on the same network, the "telnet"
> freezes and I need to type Ctrl-C:
> 
> ypig:~> strace -o str.out telnet -6 www.vinc17.net 80
> Trying 2001:4b98:dc0:45:216:3eff:fe9b:eb2f...
> ^C
> zsh: interrupt  strace -o str.out telnet -6 www.vinc17.net 80
> 
> while I also expected a ENETUNREACH error. The str.out file contains:
> 
> [...]
> socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 3
> setsockopt(3, SOL_IP, IP_TOS, [16], 4)  = 0
> connect(3, {sa_family=AF_INET6, sin6_port=htons(80), inet_pton(AF_INET6, "2001:4b98:dc0:45:216:3eff:fe9b:eb2f", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
> [...]
> 
> (the ERESTARTSYS is due to the Ctrl-C, otherwise the connect()
> system call freezes). Where does the problem come from?
> 
> The www.vinc17.net is just an example. Same problem with the Debian
> mirrors, for instance. This is really annoying as this introduces a
> huge timeout for apt-get.

What's the result of:

ip -6 ro get 2001:4b98:dc0:45:216:3eff:fe9b:eb2f

Is there anything meaningful shown in tcpdump?

Reco


Reply to: