From: Yu Watanabe Date: Fri, 6 Aug 2021 10:37:16 +0000 (+0900) Subject: network: use monotonic instead of boot time to handle address creation/update timestamp X-Git-Tag: v250-rc1~864 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5865dc1493e5519549d24fef23a2ce5c812eca32;p=thirdparty%2Fsystemd.git network: use monotonic instead of boot time to handle address creation/update timestamp Follow-up for 25db3aeaf32ba95bad5e765720ebc23c8ef77a99 and 899034ba8167bd16e802cfbea29a9ee85dee5be5. Fixes another issue in #20244. --- diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index 96a3ef9cb82..e5e6f5ac7f6 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -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");