Skip to content

Commit

Permalink
netfilter: x_tables: added hook number into match extension parameter…
Browse files Browse the repository at this point in the history
… structure.

Signed-off-by: Evgeniy Polyakov <[email protected]>
Signed-off-by: Patrick McHardy <[email protected]>
  • Loading branch information
bioothod authored and kaber committed Jun 4, 2009
1 parent e34d5c1 commit a5e7882
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions include/linux/netfilter/x_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,20 @@ struct xt_counters_info
* @matchinfo: per-match data
* @fragoff: packet is a fragment, this is the data offset
* @thoff: position of transport header relative to skb->data
* @hotdrop: drop packet if we had inspection problems
* @hook: hook number given packet came from
* @family: Actual NFPROTO_* through which the function is invoked
* (helpful when match->family == NFPROTO_UNSPEC)
* @hotdrop: drop packet if we had inspection problems
*/
struct xt_match_param {
const struct net_device *in, *out;
const struct xt_match *match;
const void *matchinfo;
int fragoff;
unsigned int thoff;
bool *hotdrop;
unsigned int hooknum;
u_int8_t family;
bool *hotdrop;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion net/bridge/netfilter/ebtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff *skb,
mtpar.in = tgpar.in = in;
mtpar.out = tgpar.out = out;
mtpar.hotdrop = &hotdrop;
tgpar.hooknum = hook;
mtpar.hooknum = tgpar.hooknum = hook;

read_lock_bh(&table->lock);
private = table->private;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ip_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ ipt_do_table(struct sk_buff *skb,
mtpar.in = tgpar.in = in;
mtpar.out = tgpar.out = out;
mtpar.family = tgpar.family = NFPROTO_IPV4;
tgpar.hooknum = hook;
mtpar.hooknum = tgpar.hooknum = hook;

IP_NF_ASSERT(table->valid_hooks & (1 << hook));
xt_info_rdlock_bh();
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ ip6t_do_table(struct sk_buff *skb,
mtpar.in = tgpar.in = in;
mtpar.out = tgpar.out = out;
mtpar.family = tgpar.family = NFPROTO_IPV6;
tgpar.hooknum = hook;
mtpar.hooknum = tgpar.hooknum = hook;

IP_NF_ASSERT(table->valid_hooks & (1 << hook));

Expand Down

0 comments on commit a5e7882

Please sign in to comment.