Re: connect() with AF_INET6 freezes on some Debian/unstable machine
On Wed, Apr 08, 2015 at 12:00:59AM +0200, Vincent Lefevre wrote:
> I now get:
> unreachable 2001:4b98:dc0:45:216:3eff:fe9b:eb2f from :: dev lo table unspec proto kernel src 2001:1::21f:29ff:fe04:3efb metric 4294967295 error -101
> like on the other machines, i.e. the problem has disappeared without
> doing anything special.
No. There was special part (see below).
> > So, the kernel tries to route your request via the link-local
> > address. That's weird, I'd expect such behavior if your host
> > accepted Routing Advertisement, but you say that all you have is
> > 'scope global' (RA-assigned addresses are 'scope tentative').
> I also have the usual "scope link" one. What I've said is that's the
> only machine where I have a "scope global" address (but I can now see
> that this isn't the cause of the problem). Another machine on the same
> network (but under Debian/stable and with a different config) doesn't
> have such a "scope global" address; so, I was wondering whether this
> was expected.
I was wrong above then. You experienced Router Advertisement aka SLAAC
(Stateless address autoconfiguration).
> > Can I see the output of the following, please:
> > ip -6 a l dev eth0
> ypig:~> ip -6 a l dev eth0
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
> inet6 2001:1::21f:29ff:fe04:3efb/64 scope global mngtmpaddr dynamic
> valid_lft 2557017sec preferred_lft 569817sec
This. Every time you see this - that means your host received an advice
to configure IPv6 address from an advertised network and to use the
sender as a router. Your host's routing table shows exactly the same.
SLAAC is a good thing if the host that advertises RA is an actual
router. If it is not - you get exactly the behavior you got.
The correct way to deal with this then is to disable accepting RAs on
echo 1 > /proc/sys/net/ipv6/conf/all/accept_ra