aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-03-03 15:20:57 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-03 15:20:57 -0500
commit988b705077d8f922408913f4f521ae073256d4a1 (patch)
tree9b57725b954e1e96a80043ed43d83f8e032b47b6 /drivers/net/bonding
parent8ed7edce82ca0d8d3adba8c08cd42337af6c758c (diff)
[ARP]: Introduce the arp_hdr_len helper.
There are some place, that calculate the ARP header length. These calculations are correct, but a) some operate with "magic" constants, b) enlarge the code length (sometimes at the cost of coding style), c) are not informative from the first glance. The proposal is to introduce a helper, that includes all the good sides of these calculations. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 966643473da7..5fc9d8d58ece 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2646,10 +2646,7 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
2646 if (!slave || !slave_do_arp_validate(bond, slave)) 2646 if (!slave || !slave_do_arp_validate(bond, slave))
2647 goto out_unlock; 2647 goto out_unlock;
2648 2648
2649 /* ARP header, plus 2 device addresses, plus 2 IP addresses. */ 2649 if (!pskb_may_pull(skb, arp_hdr_len(dev)))
2650 if (!pskb_may_pull(skb, (sizeof(struct arphdr) +
2651 (2 * dev->addr_len) +
2652 (2 * sizeof(u32)))))
2653 goto out_unlock; 2650 goto out_unlock;
2654 2651
2655 arp = arp_hdr(skb); 2652 arp = arp_hdr(skb);