network: use monotonic instead of boot time to handle address creation/update timestamp

Follow-up for 25db3aeaf3 and 899034ba81.

Fixes another issue in #20244.
This commit is contained in:
Yu Watanabe
2021-08-06 19:37:16 +09:00
committed by Lennart Poettering
parent bd73806888
commit 5865dc1493

View File

@@ -765,7 +765,9 @@ static int ndisc_router_process_autonomous_prefix(Link *link, sd_ndisc_router *r
assert(link);
assert(rt);
r = sd_ndisc_router_get_timestamp(rt, clock_boottime_or_monotonic(), &time_now);
/* Do not use clock_boottime_or_monotonic() here, as the kernel internally manages cstamp and
* tstamp with jiffies, and it is not increased while the system is suspended. */
r = sd_ndisc_router_get_timestamp(rt, CLOCK_MONOTONIC, &time_now);
if (r < 0)
return log_link_error_errno(link, r, "Failed to get RA timestamp: %m");