代码拉取完成,页面将自动刷新
From 664f8f1bea7f3c46bdfcd637e694e2c3c627fa7b Mon Sep 17 00:00:00 2001
From: Thomas Egerer <thomas.egerer@secunet.com>
Date: Tue, 17 Oct 2023 11:10:26 +0000
Subject: [PATCH] xfrm: clear XFRM_SP_ATTR_TMPL when removing the last template
from a policy
Leaving XFRM_SP_ATTR_TMPL active in the mask may not impose a problem
but, when removing the last template from a policy, the value signifying
attached templates should be cleared.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Conflict:NA
Reference:https://github.com/thom311/libnl/commit/664f8f1bea7f3c46bdfcd637e694e2c3c627fa7b
---
lib/xfrm/sp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/xfrm/sp.c b/lib/xfrm/sp.c
index 30f9182..ab7cf89 100644
--- a/lib/xfrm/sp.c
+++ b/lib/xfrm/sp.c
@@ -1317,6 +1317,8 @@ void xfrmnl_sp_remove_usertemplate(struct xfrmnl_sp *sp, struct xfrmnl_user_tmpl
if (sp->ce_mask & XFRM_SP_ATTR_TMPL) {
sp->nr_user_tmpl--;
nl_list_del(&utmpl->utmpl_list);
+ if (sp->nr_user_tmpl == 0)
+ sp->ce_mask &= ~XFRM_SP_ATTR_TMPL;
}
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。