]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[LLC]: Fix llc_fixup_skb() bug
authorJochen Friedrich <jochen@scram.de>
Thu, 22 Sep 2005 07:48:46 +0000 (04:48 -0300)
committerArnaldo Carvalho de Melo <acme@mandriva.com>
Thu, 22 Sep 2005 07:48:46 +0000 (04:48 -0300)
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>
net/llc/llc_input.c

index 789eec42645186ac101a2b2e425b0214e0ee62c2..8f3addf0724c01658c8c46b96677f701c52197f8 100644 (file)
@@ -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)) {