]> git.hungrycats.org Git - linux/commitdiff
[IPV4]: Do pskb_may_pull in arp_rcv() not arp_process().
authorDavid S. Miller <davem@nuts.ninka.net>
Mon, 29 Sep 2003 20:29:19 +0000 (13:29 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Mon, 29 Sep 2003 20:29:19 +0000 (13:29 -0700)
net/ipv4/arp.c

index bfe4c406da3ec521d8d8487208d6177c8f48ea4e..ed1a20f7dc6b88ab1c2be5ad36adc38230999040 100644 (file)
@@ -630,12 +630,6 @@ int arp_process(struct sk_buff *skb)
        if (in_dev == NULL)
                goto out;
 
-       /* ARP header, plus 2 device addresses, plus 2 IP addresses.  */
-       if (!pskb_may_pull(skb, (sizeof(struct arphdr) +
-                                (2 * dev->addr_len) +
-                                (2 * sizeof(u32)))))
-               goto out;
-
        arp = skb->nh.arph;
 
        switch (dev_type) {
@@ -837,6 +831,12 @@ int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
 {
        struct arphdr *arp = skb->nh.arph;
 
+       /* ARP header, plus 2 device addresses, plus 2 IP addresses.  */
+       if (!pskb_may_pull(skb, (sizeof(struct arphdr) +
+                                (2 * dev->addr_len) +
+                                (2 * sizeof(u32)))))
+               goto freeskb;
+
        if (arp->ar_hln != dev->addr_len ||
            dev->flags & IFF_NOARP ||
            skb->pkt_type == PACKET_OTHERHOST ||