summaryrefslogtreecommitdiffstats
path: root/net/llc/llc_input.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-04-20 00:37:13 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2006-04-20 00:37:13 +0200
commit5185db09f46ed64d520d09db6e93852e44106628 (patch)
tree13d888ea59a80aafa593015f88feb4245288055c /net/llc/llc_input.c
parent[NET]: sockfd_lookup_light() returns random error for -EBADFD (diff)
downloadlinux-5185db09f46ed64d520d09db6e93852e44106628.tar.xz
linux-5185db09f46ed64d520d09db6e93852e44106628.zip
[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>
Diffstat (limited to 'net/llc/llc_input.c')
-rw-r--r--net/llc/llc_input.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index 8f3addf0724c..d62e0f9b9da3 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -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;
}