Re: [PATCH] Don't allow Managed DHCPv6 to short-circuit SLAAC



On Sat, 2011-08-20 at 13:03 +0200, Tore Anderson wrote:
> * Dan Williams
> 
> > On Thu, 2011-08-11 at 00:41 +0200, Tore Anderson wrote:
> >> Apologies, the patch appears to break real DHCPv6-only operation, i.e.,
> >> when the Autonomous flag is unset for the Prefix Information Option(s)
> >> contained in the RA.
> >>
> >> I will try to figure out how to avoid that and, if I manage to, will
> >> post an updated version of the patch. (Do feel free to beat me to it,
> >> though - I'm not at all familiar with the NetworkManager source code so
> >> I am mostly stumbling around in the dark.)
> > 
> > Sure, feel free to ask questions.
> 
> I think NM needs to differentiate between the case when the RA is
> indicating SLAAC should be used (i.e. when it contains a Prefix
> Information with Autonomous=1), and when it doesn't. IPv6 addrconf (the
> stateless kind) should only be done (and waited for) in the former case.
> (Completely independent of DHCPv6 being used or not.)

Ok, so if it doesn't include A=1 then we just wait longer for one that
does, or...?

> I was thinking that a possible quick fix would be to set the device's
> target state to got-ra if the RA received didn't contain any PIOs with
> A=1 (since the got-address state seems to mean «SLAAC completed»), but
> I'm stuck at figuring out how to determine if that is the case. From
> what I can tell, the RA flags looks identical in both cases. Any
> suggestions?

got-ra means we got the RA from the link, while got-address means that
we've checked and ensured that the kernel has added the right address to
the network interface.  After we get the RA, we have to wait for the
kernel to send the netlink notification of address addition on the
interface, and then make sure we've got the right address there, before
we can proceed.

I think here you want struct prefixmsg * -> flags and look for
IF_PREFIX_AUTOCONF, though I could be wrong.  See addrconf_prefix_rcv()
in net/ipv6/autoconf.c where I think that flag gets stuffed into struct
prefixmsg directly from the prefix option in the RA.

Dan




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