Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / net / ipx / af_ipx.c
index bef3f61..e6a50e8 100644 (file)
@@ -28,6 +28,7 @@
  *     See net/ipx/ChangeLog.
  */
 
+#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
@@ -1642,17 +1643,14 @@ static int ipx_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
        if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
                goto out;
 
-       if (!pskb_may_pull(skb, sizeof(struct ipxhdr)))
-               goto drop;
-
-       ipx_pktsize = ntohs(ipx_hdr(skb)->ipx_pktsize);
+       ipx             = ipx_hdr(skb);
+       ipx_pktsize     = ntohs(ipx->ipx_pktsize);
        
        /* Too small or invalid header? */
-       if (ipx_pktsize < sizeof(struct ipxhdr) ||
-           !pskb_may_pull(skb, ipx_pktsize))
+       if (ipx_pktsize < sizeof(struct ipxhdr)
+          || !pskb_may_pull(skb, ipx_pktsize))
                goto drop;
                         
-       ipx = ipx_hdr(skb);
        if (ipx->ipx_checksum != IPX_NO_CHECKSUM &&
           ipx->ipx_checksum != ipx_cksum(ipx, ipx_pktsize))
                goto drop;