diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-03-03 15:20:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-03 15:20:57 -0500 |
commit | 988b705077d8f922408913f4f521ae073256d4a1 (patch) | |
tree | 9b57725b954e1e96a80043ed43d83f8e032b47b6 /net/ipv4/ipconfig.c | |
parent | 8ed7edce82ca0d8d3adba8c08cd42337af6c758c (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 'net/ipv4/ipconfig.c')
-rw-r--r-- | net/ipv4/ipconfig.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index c90e75a66e81..f84041d1f623 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -459,10 +459,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
459 | if (rarp->ar_pro != htons(ETH_P_IP)) | 459 | if (rarp->ar_pro != htons(ETH_P_IP)) |
460 | goto drop; | 460 | goto drop; |
461 | 461 | ||
462 | if (!pskb_may_pull(skb, | 462 | if (!pskb_may_pull(skb, arp_hdr_len(dev))) |
463 | sizeof(struct arphdr) + | ||
464 | (2 * dev->addr_len) + | ||
465 | (2 * 4))) | ||
466 | goto drop; | 463 | goto drop; |
467 | 464 | ||
468 | /* OK, it is all there and looks valid, process... */ | 465 | /* OK, it is all there and looks valid, process... */ |