]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: use monotonic instead of boot time to handle address creation/update timestamp
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 6 Aug 2021 10:37:16 +0000 (19:37 +0900)
committerLennart Poettering <lennart@poettering.net>
Mon, 9 Aug 2021 08:33:49 +0000 (10:33 +0200)
Follow-up for 25db3aeaf32ba95bad5e765720ebc23c8ef77a99 and 899034ba8167bd16e802cfbea29a9ee85dee5be5.

Fixes another issue in #20244.

src/network/networkd-ndisc.c

index 96a3ef9cb82ea04f5c560068a80cd042360982f4..e5e6f5ac7f648afd6004cbdcffa76df0b2f39749 100644 (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");