diff options
| author | Michael Biebl <biebl@debian.org> | 2022-05-04 15:35:24 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-05-04 15:35:24 +0200 |
| commit | 9959fdb2e8ddd06f2161798ca0a39c77d67c652d (patch) | |
| tree | 2ce24a336d2b1c5fd5dec3090db312eded6c78ba /src/libnm-platform/nm-platform-utils.c | |
| parent | 8c623dddbdebe354cb94bfc559a5371a14865317 (diff) | |
New upstream version 1.37.92 upstream/1.37.92
Diffstat (limited to 'src/libnm-platform/nm-platform-utils.c')
| -rw-r--r-- | src/libnm-platform/nm-platform-utils.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libnm-platform/nm-platform-utils.c b/src/libnm-platform/nm-platform-utils.c index 9ad030df..bebc53a8 100644 --- a/src/libnm-platform/nm-platform-utils.c +++ b/src/libnm-platform/nm-platform-utils.c @@ -2132,12 +2132,15 @@ guint32 nmp_utils_lifetime_get(guint32 timestamp, guint32 lifetime, guint32 preferred, - gint32 now, + gint32 *cached_now, guint32 *out_preferred) { - guint32 t_lifetime, t_preferred; + guint32 t_lifetime; + guint32 t_preferred; + gint32 now; - nm_assert(now >= 0); + nm_assert(cached_now); + nm_assert(*cached_now >= 0); if (timestamp == 0 && lifetime == 0) { /* We treat lifetime==0 && timestamp==0 addresses as permanent addresses to allow easy @@ -2150,8 +2153,7 @@ nmp_utils_lifetime_get(guint32 timestamp, return NM_PLATFORM_LIFETIME_PERMANENT; } - if (now <= 0) - now = nm_utils_get_monotonic_timestamp_sec(); + now = nm_utils_get_monotonic_timestamp_sec_cached(cached_now); t_lifetime = nmp_utils_lifetime_rebase_relative_time_on_now(timestamp, lifetime, now); if (!t_lifetime) { |