1 Star 0 Fork 92

Fengfei.XI/systemd

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-network-use-monotonic-instead-of-boot-time-to-handle.patch 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
From 171daf2dc084fab16c0696b139b1af3f0ab9d9f0 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Fri, 6 Aug 2021 19:37:16 +0900
Subject: [PATCH] network: use monotonic instead of boot time to handle address
creation/update timestamp
Follow-up for 25db3aeaf32ba95bad5e765720ebc23c8ef77a99 and 899034ba8167bd16e802cfbea29a9ee85dee5be5.
Fixes another issue in #20244.
(cherry picked from commit 5865dc1493e5519549d24fef23a2ce5c812eca32)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/171daf2dc084fab16c0696b139b1af3f0ab9d9f0
---
src/network/networkd-ndisc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index efc4707855..e3705bfed5 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");
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fengfeixi/systemd.git
git@gitee.com:fengfeixi/systemd.git
fengfeixi
systemd
systemd
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891