Commit 096f0eb1 authored by Jochen Friedrich's avatar Jochen Friedrich Committed by Arnaldo Carvalho de Melo

[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: default avatarJochen Friedrich <jochen@scram.de>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
parent 5564af21
...@@ -99,15 +99,19 @@ static __inline__ int llc_pdu_type(struct sk_buff *skb) ...@@ -99,15 +99,19 @@ static __inline__ int llc_pdu_type(struct sk_buff *skb)
static inline int llc_fixup_skb(struct sk_buff *skb) static inline int llc_fixup_skb(struct sk_buff *skb)
{ {
u8 llc_len = 2; u8 llc_len = 2;
struct llc_pdu_sn *pdu; struct llc_pdu_un *pdu;
if (unlikely(!pskb_may_pull(skb, sizeof(*pdu)))) if (unlikely(!pskb_may_pull(skb, sizeof(*pdu))))
return 0; 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) if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) == LLC_PDU_TYPE_U)
llc_len = 1; llc_len = 1;
llc_len += 2; llc_len += 2;
if (unlikely(!pskb_may_pull(skb, llc_len)))
return 0;
skb->h.raw += llc_len; skb->h.raw += llc_len;
skb_pull(skb, llc_len); skb_pull(skb, llc_len);
if (skb->protocol == htons(ETH_P_802_2)) { if (skb->protocol == htons(ETH_P_802_2)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment