From: Jamal Hadi Salim Date: Sun, 19 Jun 2005 05:45:56 +0000 (-0700) Subject: [IPSEC] Use NLMSG_LENGTH in xfrm_exp_state_notify X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ee57eef99b9e19194677f552ebc0690ec35d62db;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [IPSEC] Use NLMSG_LENGTH in xfrm_exp_state_notify Small fixup to use netlink macros instead of hardcoding. Signed-off-by: Jamal Hadi Salim Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 9d30f732a273..ffe1b217347c 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1123,9 +1123,9 @@ nlmsg_failure: 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;