diff options
author | Jochen Friedrich <jochen@scram.de> | 2005-09-22 03:48:46 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-22 03:48:46 -0400 |
commit | 096f0eb1dff326ddebfedeb128fb48d5b7ca75e1 (patch) | |
tree | 9beeb19dc06be5b21bcc982d74b17c890640c71a /net | |
parent | 5564af21ae7900889c5151e5b16bd42cdda11a77 (diff) |
[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')
-rw-r--r-- | net/llc/llc_input.c | 8 |
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: | |||
99 | static inline int llc_fixup_skb(struct sk_buff *skb) | 99 | static inline int llc_fixup_skb(struct sk_buff *skb) |
100 | { | 100 | { |
101 | u8 llc_len = 2; | 101 | u8 llc_len = 2; |
102 | struct llc_pdu_sn *pdu; | 102 | struct llc_pdu_un *pdu; |
103 | 103 | ||
104 | if (unlikely(!pskb_may_pull(skb, sizeof(*pdu)))) | 104 | if (unlikely(!pskb_may_pull(skb, sizeof(*pdu)))) |
105 | return 0; | 105 | return 0; |
106 | 106 | ||
107 | pdu = (struct llc_pdu_sn *)skb->data; | 107 | pdu = (struct llc_pdu_un *)skb->data; |
108 | if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) == LLC_PDU_TYPE_U) | 108 | if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) == LLC_PDU_TYPE_U) |
109 | llc_len = 1; | 109 | llc_len = 1; |
110 | llc_len += 2; | 110 | llc_len += 2; |
111 | |||
112 | if (unlikely(!pskb_may_pull(skb, llc_len))) | ||
113 | return 0; | ||
114 | |||
111 | skb->h.raw += llc_len; | 115 | skb->h.raw += llc_len; |
112 | skb_pull(skb, llc_len); | 116 | skb_pull(skb, llc_len); |
113 | if (skb->protocol == htons(ETH_P_802_2)) { | 117 | if (skb->protocol == htons(ETH_P_802_2)) { |