提交 ee57eef9 编写于 作者: J Jamal Hadi Salim 提交者: David S. Miller

[IPSEC] Use NLMSG_LENGTH in xfrm_exp_state_notify

Small fixup to use netlink macros instead of hardcoding.
Signed-off-by: NJamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7d6dfe1f
......@@ -1123,9 +1123,9 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, int hard)
static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c)
{
struct sk_buff *skb;
int len = NLMSG_LENGTH(sizeof(struct xfrm_user_expire));
/* fix to do alloc using NLM macros */
skb = alloc_skb(sizeof(struct xfrm_user_expire) + 16, GFP_ATOMIC);
skb = alloc_skb(len, GFP_ATOMIC);
if (skb == NULL)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册