Subject: [GIT PULL net-next 01/17] ndisc: Fix size calculation for headers.

From: YOSHIFUJI Hideaki <[email-masked]>
Date: Tue, 18 Dec 2012 19:52:04 +0900

We used to allocate MAX_HEADER bytes more than needed but
reserved hlen only (not MAX_HEADER + hlen) and the MAX_HEADER
was left behind.

Signed-off-by: YOSHIFUJI Hideaki <[email-masked]>
---
 net/ipv6/ndisc.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index f2a007b..a1d2a45 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -395,8 +395,7 @@ static struct sk_buff *ndisc_build_skb(struct net_device *dev,
 		len += ndisc_opt_addr_space(dev);
 
 	skb = sock_alloc_send_skb(sk,
-				  (MAX_HEADER + sizeof(struct ipv6hdr) +
-				   len + hlen + tlen),
+				  hlen + sizeof(struct ipv6hdr) + len + tlen,
 				  1, &err);
 	if (!skb) {
 		ND_PRINTK(0, err, "ND: %s failed to allocate an skb, err=%d\n",
@@ -1422,8 +1421,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
 	hlen = LL_RESERVED_SPACE(dev);
 	tlen = dev->needed_tailroom;
 	buff = sock_alloc_send_skb(sk,
-				   (MAX_HEADER + sizeof(struct ipv6hdr) +
-				    len + hlen + tlen),
+				   hlen + sizeof(struct ipv6hdr) + len + tlen,
 				   1, &err);
 	if (buff == NULL) {
 		ND_PRINTK(0, err,
-- 
1.7.9.5