summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSimon Buttgereit <simon.buttgereit@gmail.com>2017-02-07 16:24:55 (GMT)
committerThomas Haller <thaller@redhat.com>2017-02-27 15:43:48 (GMT)
commit2c5b92dfaf99fb4a50017b83ddcc37ad53a2b661 (patch)
treeb066c8a70a8c0bf4339ed24395d3320a24647116 /lib
parent7efe45f96dfdd66516a2933d5ddc1bd0588fb207 (diff)
downloadlibnl-2c5b92dfaf99fb4a50017b83ddcc37ad53a2b661.zip
libnl-2c5b92dfaf99fb4a50017b83ddcc37ad53a2b661.tar.gz
libnl-2c5b92dfaf99fb4a50017b83ddcc37ad53a2b661.tar.bz2
update sp_attr condition in build_xfrm_sp_message
Identification of policy are possible with: 1. direction and index 2. direction and selector Theoretically second one needs a security context, but non existing context is valid too.
Diffstat (limited to 'lib')
-rw-r--r--lib/xfrm/sp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/xfrm/sp.c b/lib/xfrm/sp.c
index ffde1bd..5e11d3b 100644
--- a/lib/xfrm/sp.c
+++ b/lib/xfrm/sp.c
@@ -765,7 +765,9 @@ static int build_xfrm_sp_message(struct xfrmnl_sp *tmpl, int cmd, int flags, str
uint32_t len;
struct nl_addr* addr;
- if (!(tmpl->ce_mask & XFRM_SP_ATTR_DIR))
+ if (!(tmpl->ce_mask & XFRM_SP_ATTR_DIR) &&
+ (!(tmpl->ce_mask & XFRM_SP_ATTR_INDEX) ||
+ !(tmpl->ce_mask & XFRM_SP_ATTR_SEL)))
return -NLE_MISSING_ATTR;
memset ((void*)&sp_info, 0, sizeof (sp_info));