summaryrefslogtreecommitdiffstats
path: root/net/llc
diff options
context:
space:
mode:
authorJochen Friedrich <jochen@scram.de>2005-09-22 04:48:46 -0300
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-09-22 04:48:46 -0300
commit096f0eb1dff326ddebfedeb128fb48d5b7ca75e1 (patch)
tree9beeb19dc06be5b21bcc982d74b17c890640c71a /net/llc
parent5564af21ae7900889c5151e5b16bd42cdda11a77 (diff)
downloadlinux-stable-096f0eb1dff326ddebfedeb128fb48d5b7ca75e1.tar.gz
linux-stable-096f0eb1dff326ddebfedeb128fb48d5b7ca75e1.tar.bz2
linux-stable-096f0eb1dff326ddebfedeb128fb48d5b7ca75e1.zip
[LLC]: Fix llc_fixup_skb() bug
llc_fixup_skb() had a bug dropping 3 bytes packets (like UA frames). Token ring doesn't pad these frames. Signed-off-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/llc')
-rw-r--r--net/llc/llc_input.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index 789eec426451..8f3addf0724c 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -99,15 +99,19 @@ out:
static inline int llc_fixup_skb(struct sk_buff *skb)
{
u8 llc_len = 2;
- struct llc_pdu_sn *pdu;
+ struct llc_pdu_un *pdu;
if (unlikely(!pskb_may_pull(skb, sizeof(*pdu))))
return 0;
- pdu = (struct llc_pdu_sn *)skb->data;
+ pdu = (struct llc_pdu_un *)skb->data;
if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) == LLC_PDU_TYPE_U)
llc_len = 1;
llc_len += 2;
+
+ if (unlikely(!pskb_may_pull(skb, llc_len)))
+ return 0;
+
skb->h.raw += llc_len;
skb_pull(skb, llc_len);
if (skb->protocol == htons(ETH_P_802_2)) {