Skip to content

Commit

Permalink
netfilter: Pass nf_hook_state through arpt_do_table().
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Apr 4, 2015
1 parent 073bfd5 commit b85c3dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions include/linux/netfilter_arp/arp_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ extern struct xt_table *arpt_register_table(struct net *net,
extern void arpt_unregister_table(struct xt_table *table);
extern unsigned int arpt_do_table(struct sk_buff *skb,
unsigned int hook,
const struct net_device *in,
const struct net_device *out,
const struct nf_hook_state *state,
struct xt_table *table);

#ifdef CONFIG_COMPAT
Expand Down
11 changes: 5 additions & 6 deletions net/ipv4/netfilter/arp_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ struct arpt_entry *arpt_next_entry(const struct arpt_entry *entry)

unsigned int arpt_do_table(struct sk_buff *skb,
unsigned int hook,
const struct net_device *in,
const struct net_device *out,
const struct nf_hook_state *state,
struct xt_table *table)
{
static const char nulldevname[IFNAMSIZ] __attribute__((aligned(sizeof(long))));
Expand All @@ -265,8 +264,8 @@ unsigned int arpt_do_table(struct sk_buff *skb,
if (!pskb_may_pull(skb, arp_hdr_len(skb->dev)))
return NF_DROP;

indev = in ? in->name : nulldevname;
outdev = out ? out->name : nulldevname;
indev = state->in ? state->in->name : nulldevname;
outdev = state->out ? state->out->name : nulldevname;

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

acpar.in = in;
acpar.out = out;
acpar.in = state->in;
acpar.out = state->out;
acpar.hooknum = hook;
acpar.family = NFPROTO_ARP;
acpar.hotdrop = false;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/arptable_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ arptable_filter_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
{
const struct net *net = dev_net(state->in ? state->in : state->out);

return arpt_do_table(skb, ops->hooknum, state->in, state->out,
return arpt_do_table(skb, ops->hooknum, state,
net->ipv4.arptable_filter);
}

Expand Down

0 comments on commit b85c3dc

Please sign in to comment.