diff options
author | Thomas Haller <thaller@redhat.com> | 2020-07-29 13:30:08 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-07-31 08:53:05 +0200 |
commit | 0acb5773202e6e962b7b80512bb2e2f3e82873cb (patch) | |
tree | 770ea39b6fab559831ceaa51fd6455449a8e959c /src | |
parent | dca62c06fdef989480d7b2222487875fb835e740 (diff) |
platform: minor cleanup in nm_platform_ip_address_sync()
The known address must not have a zero lifetime,
because we filter those addresses out first.
Diffstat (limited to 'src')
-rw-r--r-- | src/platform/nm-platform.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 94ad209cb0..4415aa84c1 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -3577,8 +3577,11 @@ _addr_array_clean_expired (int addr_family, int ifindex, GPtrArray *array, guint goto clear_and_next; } - if (!nm_utils_lifetime_get (a->timestamp, a->lifetime, a->preferred, - now, NULL)) + if (!nm_utils_lifetime_get (a->timestamp, + a->lifetime, + a->preferred, + now, + NULL)) goto clear_and_next; if (idx) { @@ -4061,9 +4064,9 @@ next_plat: known_address->ax.preferred, now, &preferred); + nm_assert (lifetime > 0); + if (IS_IPv4) { - if (lifetime <= 0) - goto delete_and_next2; if (!nm_platform_ip4_address_add (self, ifindex, known_address->a4.address, @@ -4073,8 +4076,9 @@ next_plat: lifetime, preferred, ifa_flags, - known_address->a4.label)) - goto delete_and_next2; + known_address->a4.label)) { + /* ignore error, for unclear reasons. */ + } } else { if (!nm_platform_ip6_address_add (self, ifindex, @@ -4087,11 +4091,6 @@ next_plat: | known_address->a6.n_ifa_flags)) return FALSE; } - continue; - -delete_and_next2: - nmp_object_unref (o); - known_addresses->pdata[i_know] = NULL; } return TRUE; |