Commit f667009e authored by Changli Gao's avatar Changli Gao Committed by Patrick McHardy

netfilter: arptables: use arp_hdr_len()

use arp_hdr_len().
Signed-off-by: default avatarChangli Gao <xiaosuo@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent c36952e5
...@@ -283,16 +283,13 @@ unsigned int arpt_do_table(struct sk_buff *skb, ...@@ -283,16 +283,13 @@ unsigned int arpt_do_table(struct sk_buff *skb,
arp = arp_hdr(skb); arp = arp_hdr(skb);
do { do {
const struct arpt_entry_target *t; const struct arpt_entry_target *t;
int hdr_len;
if (!arp_packet_match(arp, skb->dev, indev, outdev, &e->arp)) { if (!arp_packet_match(arp, skb->dev, indev, outdev, &e->arp)) {
e = arpt_next_entry(e); e = arpt_next_entry(e);
continue; continue;
} }
hdr_len = sizeof(*arp) + (2 * sizeof(struct in_addr)) + ADD_COUNTER(e->counters, arp_hdr_len(skb->dev), 1);
(2 * skb->dev->addr_len);
ADD_COUNTER(e->counters, hdr_len, 1);
t = arpt_get_target_c(e); t = arpt_get_target_c(e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment