mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
[NETFILTER]: x_tables: pass registered match/target data to match/target functions
This allows to make decisions based on the revision (and address family with a follow-up patch) at runtime. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
5d04bff096
commit
1c524830d0
5 changed files with 30 additions and 19 deletions
|
|
@ -300,6 +300,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
|
|||
verdict = t->u.kernel.target->target(pskb,
|
||||
in, out,
|
||||
hook,
|
||||
t->u.kernel.target,
|
||||
t->data,
|
||||
userdata);
|
||||
|
||||
|
|
@ -491,7 +492,7 @@ static inline int check_entry(struct arpt_entry *e, const char *name, unsigned i
|
|||
goto out;
|
||||
}
|
||||
} else if (t->u.kernel.target->checkentry
|
||||
&& !t->u.kernel.target->checkentry(name, e, t->data,
|
||||
&& !t->u.kernel.target->checkentry(name, e, target, t->data,
|
||||
t->u.target_size
|
||||
- sizeof(*t),
|
||||
e->comefrom)) {
|
||||
|
|
@ -560,7 +561,7 @@ static inline int cleanup_entry(struct arpt_entry *e, unsigned int *i)
|
|||
|
||||
t = arpt_get_target(e);
|
||||
if (t->u.kernel.target->destroy)
|
||||
t->u.kernel.target->destroy(t->data,
|
||||
t->u.kernel.target->destroy(t->u.kernel.target, t->data,
|
||||
t->u.target_size - sizeof(*t));
|
||||
module_put(t->u.kernel.target->me);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -197,8 +197,8 @@ int do_match(struct ipt_entry_match *m,
|
|||
int *hotdrop)
|
||||
{
|
||||
/* Stop iteration if it doesn't match */
|
||||
if (!m->u.kernel.match->match(skb, in, out, m->data, offset,
|
||||
skb->nh.iph->ihl*4, hotdrop))
|
||||
if (!m->u.kernel.match->match(skb, in, out, m->u.kernel.match, m->data,
|
||||
offset, skb->nh.iph->ihl*4, hotdrop))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -305,6 +305,7 @@ ipt_do_table(struct sk_buff **pskb,
|
|||
verdict = t->u.kernel.target->target(pskb,
|
||||
in, out,
|
||||
hook,
|
||||
t->u.kernel.target,
|
||||
t->data,
|
||||
userdata);
|
||||
|
||||
|
|
@ -464,7 +465,7 @@ cleanup_match(struct ipt_entry_match *m, unsigned int *i)
|
|||
return 1;
|
||||
|
||||
if (m->u.kernel.match->destroy)
|
||||
m->u.kernel.match->destroy(m->data,
|
||||
m->u.kernel.match->destroy(m->u.kernel.match, m->data,
|
||||
m->u.match_size - sizeof(*m));
|
||||
module_put(m->u.kernel.match->me);
|
||||
return 0;
|
||||
|
|
@ -517,7 +518,7 @@ check_match(struct ipt_entry_match *m,
|
|||
goto err;
|
||||
|
||||
if (m->u.kernel.match->checkentry
|
||||
&& !m->u.kernel.match->checkentry(name, ip, m->data,
|
||||
&& !m->u.kernel.match->checkentry(name, ip, match, m->data,
|
||||
m->u.match_size - sizeof(*m),
|
||||
hookmask)) {
|
||||
duprintf("ip_tables: check failed for `%s'.\n",
|
||||
|
|
@ -578,7 +579,7 @@ check_entry(struct ipt_entry *e, const char *name, unsigned int size,
|
|||
goto cleanup_matches;
|
||||
}
|
||||
} else if (t->u.kernel.target->checkentry
|
||||
&& !t->u.kernel.target->checkentry(name, e, t->data,
|
||||
&& !t->u.kernel.target->checkentry(name, e, target, t->data,
|
||||
t->u.target_size
|
||||
- sizeof(*t),
|
||||
e->comefrom)) {
|
||||
|
|
@ -652,7 +653,7 @@ cleanup_entry(struct ipt_entry *e, unsigned int *i)
|
|||
IPT_MATCH_ITERATE(e, cleanup_match, NULL);
|
||||
t = ipt_get_target(e);
|
||||
if (t->u.kernel.target->destroy)
|
||||
t->u.kernel.target->destroy(t->data,
|
||||
t->u.kernel.target->destroy(t->u.kernel.target, t->data,
|
||||
t->u.target_size - sizeof(*t));
|
||||
module_put(t->u.kernel.target->me);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue