diff options
author | Thomas Egerer <thomas.egerer@secunet.com> | 2020-03-10 13:51:35 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-04-16 15:28:04 (GMT) |
commit | 47fb1c03921c082da555a732f6dcd1098d657738 (patch) | |
tree | 2bbacf26403f2169b5e0eef1eeb68758305df464 /lib/xfrm/sa.c | |
parent | 846d2880079cd3fe3819a9126428b0e2dd4a384c (diff) | |
download | libnl-47fb1c03921c082da555a732f6dcd1098d657738.zip libnl-47fb1c03921c082da555a732f6dcd1098d657738.tar.gz libnl-47fb1c03921c082da555a732f6dcd1098d657738.tar.bz2 |
xfrm: remove superfluous xfrm_usersa_id from dump request
When being used with the dump flag, the kernel dispatches the request to
xfrm_dump_sa. This function does not expect the netlink message to
contain a struct xfrm_usersa_id as data payload of the netlink message.
Instead it interprets this payload as xfrm attributes. With the current
implementation, due to the sa_id being memset to zero, it causes the
kernel to complain about '24 bytes leftover after parsing attributes
[...]'.
This patch removes payload to get rid of the kernel complaint.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
https://github.com/thom311/libnl/pull/233
Diffstat (limited to 'lib/xfrm/sa.c')
-rw-r--r-- | lib/xfrm/sa.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/xfrm/sa.c b/lib/xfrm/sa.c index 6e88cdb..f6b44a2 100644 --- a/lib/xfrm/sa.c +++ b/lib/xfrm/sa.c @@ -650,11 +650,7 @@ static struct nla_policy xfrm_sa_policy[XFRMA_MAX+1] = { static int xfrm_sa_request_update(struct nl_cache *c, struct nl_sock *h) { - struct xfrm_id sa_id; - - memset (&sa_id, 0, sizeof (sa_id)); - return nl_send_simple (h, XFRM_MSG_GETSA, NLM_F_DUMP, - &sa_id, sizeof (sa_id)); + return nl_send_simple (h, XFRM_MSG_GETSA, NLM_F_DUMP, NULL, 0); } int xfrmnl_sa_parse(struct nlmsghdr *n, struct xfrmnl_sa **result) |