Skip to content

Commit

Permalink
xfrm: clear XFRM_SP_ATTR_TMPL when removing the last template from a …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
spellingmistake authored and thom311 committed Nov 27, 2023
1 parent c4c22d2 commit 664f8f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/xfrm/sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,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;
}
}

Expand Down

0 comments on commit 664f8f1

Please sign in to comment.