Skip to content

Commit b85c3dc

Browse files
committed
netfilter: Pass nf_hook_state through arpt_do_table().
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 073bfd5 commit b85c3dc

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎include/linux/netfilter_arp/arp_tables.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ extern struct xt_table *arpt_register_table(struct net *net,
5454
extern void arpt_unregister_table(struct xt_table *table);
5555
extern unsigned int arpt_do_table(struct sk_buff *skb,
5656
unsigned int hook,
57-
const struct net_device *in,
58-
const struct net_device *out,
57+
const struct nf_hook_state *state,
5958
struct xt_table *table);
6059

6160
#ifdef CONFIG_COMPAT

‎net/ipv4/netfilter/arp_tables.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ struct arpt_entry *arpt_next_entry(const struct arpt_entry *entry)
248248

249249
unsigned int arpt_do_table(struct sk_buff *skb,
250250
unsigned int hook,
251-
const struct net_device *in,
252-
const struct net_device *out,
251+
const struct nf_hook_state *state,
253252
struct xt_table *table)
254253
{
255254
static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
@@ -265,8 +264,8 @@ unsigned int arpt_do_table(struct sk_buff *skb,
265264
if (!pskb_may_pull(skb, arp_hdr_len(skb->dev)))
266265
return NF_DROP;
267266

268-
indev = in ? in->name : nulldevname;
269-
outdev = out ? out->name : nulldevname;
267+
indev = state->in ? state->in->name : nulldevname;
268+
outdev = state->out ? state->out->name : nulldevname;
270269

271270
local_bh_disable();
272271
addend = xt_write_recseq_begin();
@@ -281,8 +280,8 @@ unsigned int arpt_do_table(struct sk_buff *skb,
281280
e = get_entry(table_base, private->hook_entry[hook]);
282281
back = get_entry(table_base, private->underflow[hook]);
283282

284-
acpar.in = in;
285-
acpar.out = out;
283+
acpar.in = state->in;
284+
acpar.out = state->out;
286285
acpar.hooknum = hook;
287286
acpar.family = NFPROTO_ARP;
288287
acpar.hotdrop = false;

‎net/ipv4/netfilter/arptable_filter.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ arptable_filter_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
3232
{
3333
const struct net *net = dev_net(state->in ? state->in : state->out);
3434

35-
return arpt_do_table(skb, ops->hooknum, state->in, state->out,
35+
return arpt_do_table(skb, ops->hooknum, state,
3636
net->ipv4.arptable_filter);
3737
}
3838

0 commit comments

Comments
 (0)