9 Star 0 Fork 17

src-openEuler / libnl3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-clear-XFRM_SP_ATTR_TMPL-when-removing-the-last-template.patch 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
sun_hai 提交于 2024-04-25 21:26 . sync some pathes from upstream
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
1
https://gitee.com/src-openeuler/libnl3.git
git@gitee.com:src-openeuler/libnl3.git
src-openeuler
libnl3
libnl3
master

搜索帮助