Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349742
b: refs/heads/master
c: 044453b
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 11, 2013
1 parent 52070e9 commit 45e712b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 839c8cc32bc252345f4d5767d2d6cf695f2124ab
refs/heads/master: 044453b3efdc90bdd5feffe74b99d95dec70ac43
21 changes: 11 additions & 10 deletions trunk/net/ipv4/arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,24 +928,25 @@ static void parp_redo(struct sk_buff *skb)
static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev)
{
struct arphdr *arp;
const struct arphdr *arp;

if (dev->flags & IFF_NOARP ||
skb->pkt_type == PACKET_OTHERHOST ||
skb->pkt_type == PACKET_LOOPBACK)
goto freeskb;

skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb)
goto out_of_mem;

/* ARP header, plus 2 device addresses, plus 2 IP addresses. */
if (!pskb_may_pull(skb, arp_hdr_len(dev)))
goto freeskb;

arp = arp_hdr(skb);
if (arp->ar_hln != dev->addr_len ||
dev->flags & IFF_NOARP ||
skb->pkt_type == PACKET_OTHERHOST ||
skb->pkt_type == PACKET_LOOPBACK ||
arp->ar_pln != 4)
if (arp->ar_hln != dev->addr_len || arp->ar_pln != 4)
goto freeskb;

skb = skb_share_check(skb, GFP_ATOMIC);
if (skb == NULL)
goto out_of_mem;

memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb));

return NF_HOOK(NFPROTO_ARP, NF_ARP_IN, skb, dev, NULL, arp_process);
Expand Down

0 comments on commit 45e712b

Please sign in to comment.