[IPSEC] Use NLMSG_LENGTH in xfrm_exp_state_notify
Small fixup to use netlink macros instead of hardcoding. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7d6dfe1f5b
commit
ee57eef99b
@ -1123,9 +1123,9 @@ nlmsg_failure:
|
|||||||
static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c)
|
static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
int len = NLMSG_LENGTH(sizeof(struct xfrm_user_expire));
|
||||||
|
|
||||||
/* fix to do alloc using NLM macros */
|
skb = alloc_skb(len, GFP_ATOMIC);
|
||||||
skb = alloc_skb(sizeof(struct xfrm_user_expire) + 16, GFP_ATOMIC);
|
|
||||||
if (skb == NULL)
|
if (skb == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user