2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-18 23:54:26 +08:00

[LLC]: Use pskb_trim_rcsum() in llc_fixup_skb().

Kernel Bugzilla #6409

If we use plain skb_trim(), that's wrong, because if
the SKB is cloned, and it can be because we unshared
it in the caller, we have to allow reallocation.  The
pskb_trim*() family of routines is therefore the most
appropriate here.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2006-04-19 15:37:13 -07:00
parent 3672558c61
commit 5185db09f4

View File

@ -118,7 +118,8 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
u16 pdulen = eth_hdr(skb)->h_proto,
data_size = ntohs(pdulen) - llc_len;
skb_trim(skb, data_size);
if (unlikely(pskb_trim_rcsum(skb, data_size)))
return 0;
}
return 1;
}