summaryrefslogtreecommitdiffstats
path: root/lib/xfrm
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-05-12 12:45:08 (GMT)
committerThomas Haller <thaller@redhat.com>2015-05-12 12:56:57 (GMT)
commitc3dd6a7355ace3d1fca1e82a0eb21e0e43dddfba (patch)
treeb1cadac8b95af1e3ced200399e6ccf3a7082d64e /lib/xfrm
parenteae6a6875c1f3b6f5c45b9bd39d5500622a239db (diff)
downloadlibnl-c3dd6a7355ace3d1fca1e82a0eb21e0e43dddfba.zip
libnl-c3dd6a7355ace3d1fca1e82a0eb21e0e43dddfba.tar.gz
libnl-c3dd6a7355ace3d1fca1e82a0eb21e0e43dddfba.tar.bz2
xfrm: trival refactoring initialization of stack-allocated arguments to nl_send_simple()
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/xfrm')
-rw-r--r--lib/xfrm/sa.c7
-rw-r--r--lib/xfrm/sp.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/xfrm/sa.c b/lib/xfrm/sa.c
index 693eee4..34d24cf 100644
--- a/lib/xfrm/sa.c
+++ b/lib/xfrm/sa.c
@@ -643,10 +643,11 @@ 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;
+ struct xfrm_id sa_id;
- memset ((void *)&sa_id, 0, sizeof (struct xfrm_id));
- return nl_send_simple (h, XFRM_MSG_GETSA, NLM_F_DUMP,(void*)&sa_id, sizeof (struct xfrm_id));
+ memset (&sa_id, 0, sizeof (sa_id));
+ return nl_send_simple (h, XFRM_MSG_GETSA, NLM_F_DUMP,
+ &sa_id, sizeof (sa_id));
}
int xfrmnl_sa_parse(struct nlmsghdr *n, struct xfrmnl_sa **result)
diff --git a/lib/xfrm/sp.c b/lib/xfrm/sp.c
index 74e9484..943269a 100644
--- a/lib/xfrm/sp.c
+++ b/lib/xfrm/sp.c
@@ -506,10 +506,11 @@ static struct nla_policy xfrm_sp_policy[XFRMA_MAX+1] = {
static int xfrm_sp_request_update(struct nl_cache *c, struct nl_sock *h)
{
- struct xfrm_userpolicy_id sp_id;
+ struct xfrm_userpolicy_id sp_id;
- memset ((void *)&sp_id, 0, sizeof (struct xfrm_userpolicy_id));
- return nl_send_simple (h, XFRM_MSG_GETPOLICY, NLM_F_DUMP,(void*)&sp_id, sizeof (struct xfrm_userpolicy_id));
+ memset (&sp_id, 0, sizeof (sp_id));
+ return nl_send_simple (h, XFRM_MSG_GETPOLICY, NLM_F_DUMP,
+ &sp_id, sizeof (sp_id));
}
int xfrmnl_sp_parse(struct nlmsghdr *n, struct xfrmnl_sp **result)