device: check captured IPv6 configuration in check_and_add_ipv6ll_addr()

check_and_add_ipv6ll_addr() checks whether a link-local address is
already present in priv->ip6_config and if so, it returns with no
action.

priv->ip6_config is only updated after a merge-and-apply or (in an
idle source) when the external configuration changes and so there is
no guarantee that the addresses there are up-to-date.

priv->ext_ip6_config_captured should be checked instead, because it is
updated from platform right before starting the generation of a
link-local address. Note that also linklocal6_start() already checks
the captured external configuration rather than priv->ip6_config.

https://bugzilla.redhat.com/show_bug.cgi?id=1500350
This commit is contained in:
Beniamino Galvani 2017-10-16 16:27:55 +02:00
parent 25267f9d27
commit a7c97d58db

View file

@ -7115,11 +7115,11 @@ check_and_add_ipv6ll_addr (NMDevice *self)
if (priv->nm_ipv6ll == FALSE)
return;
if (priv->ip6_config) {
if (priv->ext_ip6_config_captured) {
NMDedupMultiIter ipconf_iter;
const NMPlatformIP6Address *addr;
nm_ip_config_iter_ip6_address_for_each (&ipconf_iter, priv->ip6_config, &addr) {
nm_ip_config_iter_ip6_address_for_each (&ipconf_iter, priv->ext_ip6_config_captured, &addr) {
if ( IN6_IS_ADDR_LINKLOCAL (&addr->address)
&& !(addr->n_ifa_flags & IFA_F_DADFAILED)) {
/* Already have an LL address, nothing to do */