diff options
author | Thomas Haller <thaller@redhat.com> | 2018-02-09 15:10:50 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-02-09 15:10:52 +0100 |
commit | d804acd00e08795e7965a79c21b368529500d0a3 (patch) | |
tree | 4b69fb714d6d65eadf0b64c04b7b83b7420fe480 | |
parent | eebe8e0633cc8e2aff30580c89166e086f749ba9 (diff) | |
download | NetworkManager-th/ip6-temp-addr-sync-rh1542609.tar.gz |
fixup! device: fix IPv6 DAD to re-check whether address really failed DADth/ip6-temp-addr-sync-rh1542609
Fix crash, https://bugzilla.redhat.com/show_bug.cgi?id=1543892
-rw-r--r-- | src/devices/nm-device.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index ea4e7d59aa..14dc0e376b 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -11543,14 +11543,16 @@ queued_ip6_config_change (gpointer user_data) && nm_platform_link_get (platform, priv->ifindex)) { /* Handle DAD failures */ for (iter = priv->dad6_failed_addrs; iter; iter = iter->next) { - const NMPlatformIP6Address *addr; - - addr = NMP_OBJECT_CAST_IP6_ADDRESS (nm_platform_lookup_obj (platform, - NMP_CACHE_ID_TYPE_OBJECT_TYPE, - iter->data)); - if ( addr - && ( NM_FLAGS_HAS (addr->n_ifa_flags, IFA_F_SECONDARY) - || !NM_FLAGS_HAS (addr->n_ifa_flags, IFA_F_DADFAILED))) { + const NMPObject *obj = iter->data; + const NMPlatformIP6Address *addr = NMP_OBJECT_CAST_IP6_ADDRESS (obj); + const NMPlatformIP6Address *addr2; + + addr2 = NMP_OBJECT_CAST_IP6_ADDRESS (nm_platform_lookup_obj (platform, + NMP_CACHE_ID_TYPE_OBJECT_TYPE, + obj)); + if ( addr2 + && ( NM_FLAGS_HAS (addr2->n_ifa_flags, IFA_F_SECONDARY) + || !NM_FLAGS_HAS (addr2->n_ifa_flags, IFA_F_DADFAILED))) { /* the address still/again exists and is not in DADFAILED state. Skip it. */ continue; } |