net: Copy ndisc_nodetype from original skb in skb_clone

skb_clone does not copy all fields from original skb. Fields
which are uninitialized may cause unexpected behavior when they
are passed down to network stack. In case ndisc_nodetype is set
to a random value for a router advertisement, kernel looks at this
field and drops it assuming that this packet originates from a
node and not a router.

Fix this by copying the ndisc_nodetype from the original skb
rather than relying on an uninitialized cloned skb.

CRs-Fixed: 872241
Change-Id: I9686e31808c94a3bbf309007f521c0e06bac2e96
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
Subash Abhinov Kasiviswanathan 2015-07-14 13:57:52 -06:00 committed by Gerrit - the friendly Code Review server
parent fb308c0002
commit 86813131fd
1 changed files with 4 additions and 0 deletions

View File

@ -744,6 +744,10 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
atomic_inc(&(skb_shinfo(skb)->dataref));
skb->cloned = 1;
#ifdef CONFIG_IPV6_NDISC_NODETYPE
C(ndisc_nodetype);
#endif
return n;
#undef C
}