FS#26370 - [netcfg] IPv6 SLAAC address/route bug
Attached to Project:
Arch Linux
Opened by Evan Callicoat (Apsu) - Monday, 10 October 2011, 03:01 GMT
Last edited by Jouke Witteveen (jouke) - Friday, 11 May 2012, 19:44 GMT
Opened by Evan Callicoat (Apsu) - Monday, 10 October 2011, 03:01 GMT
Last edited by Jouke Witteveen (jouke) - Friday, 11 May 2012, 19:44 GMT
|
Details
Description:
If you are running a dual-stack (IPv4 and IPv6) configuration through netcfg with a SLAAC router and you only specify the IP= variable, but not the IP6= variable, the code at line 141 of /usr/lib/network/connections/ethernet will set the accept_ra sysctl to 0 (off) for the interface, but this occurs *after* the interface is brought up and some other setup code is run. It turns out that the delay between those two points is sufficient for a router solicitation and router advertisement to occur, which gives the interface an IPv6 address and IPv6 default route for whatever lifetime(s) the router is configured to advertise. This will make the autoconfigured adapter work on IPv6, until the leases time out, which will occur because no new router advertisements will be processed due to the sysctl. While the expected behavior in the case of not specifying "IP6" might make sense to disable SLAAC adverts, this bit of code needs to be moved up to occur *before* the interface is upped (line 25), so no solicitation/advertisement handshake is completed. Alternatively, perhaps this is not or shouldn't be the expected behavior and accept_ra=0 shouldn't be the default without IP6 specified, perhaps instead defaulting to the same behavior as specifying 'stateless', which is more in line with the default on other operating systems/linux distros. Additional info: * package version(s) - 2.6.8-1 * config and/or log files etc. - /usr/lib/network/connections/ethernet Steps to reproduce: * Copy one of the /etc/network.d/examples/ethernet-* files to /etc/network.d * Edit the file appropriately for IPv4 config (static, dhcp, etc), but do not uncomment/set the IP6 variable * netcfg up the profile on a network with a working SLAAC router (such as linux using radvd) * Observe with ip -6 a/ip -6 r that the advertised prefix/route IPs are present * Wait until lifetime expires, or monitor adverts with radvdump, observing that the prefix/route IPs don't refresh/ultimately expire. |
This task depends upon
Closed by Jouke Witteveen (jouke)
Friday, 11 May 2012, 19:44 GMT
Reason for closing: Fixed
Additional comments about closing: thanks
Friday, 11 May 2012, 19:44 GMT
Reason for closing: Fixed
Additional comments about closing: thanks
* empty $IP6 is a no-op and does nothing
* IP6=no sets accept_ra to 0 as well as run ip -6 addr flush dev "$INTERFACE", is it ok ?
- turn undefined IP6 into a nop
- before the interface is brought up, check for IP6 = "no" and if so set disable_ipv6=1
The patch is attached, I'm setting up a public repo at github for collecting patches and bugfixes as I want to revive netcfg and eventually become it's maintainer :)
Greetings,
Christoph