mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 13:15:12 +02:00
compat_xtables: move to 2.6.35 xt_action_param (1/3)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* API compat layer
|
||||
* written by Jan Engelhardt <jengelh [at] medozas de>, 2008
|
||||
* written by Jan Engelhardt <jengelh [at] medozas de>, 2008 - 2010
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License, either
|
||||
@@ -35,16 +35,15 @@ static bool xtnu_match_run(const struct sk_buff *skb,
|
||||
{
|
||||
struct xtnu_match *nm = xtcompat_numatch(cm);
|
||||
bool lo_drop = false, lo_ret;
|
||||
struct xt_match_param local_par = {
|
||||
.in = in,
|
||||
.out = out,
|
||||
.match = cm,
|
||||
.matchinfo = matchinfo,
|
||||
.fragoff = offset,
|
||||
.thoff = protoff,
|
||||
.hotdrop = &lo_drop,
|
||||
.family = NFPROTO_UNSPEC, /* don't have that info */
|
||||
};
|
||||
struct xt_action_param local_par;
|
||||
local_par.in = in;
|
||||
local_par.out = out;
|
||||
local_par.match = cm;
|
||||
local_par.matchinfo = matchinfo;
|
||||
local_par.fragoff = offset;
|
||||
local_par.thoff = protoff;
|
||||
local_par.hotdrop = &lo_drop;
|
||||
local_par.family = NFPROTO_UNSPEC; /* don't have that info */
|
||||
|
||||
if (nm == NULL || nm->match == NULL)
|
||||
return false;
|
||||
@@ -53,6 +52,28 @@ static bool xtnu_match_run(const struct sk_buff *skb,
|
||||
return lo_ret;
|
||||
}
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
||||
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||
static bool xtnu_match_run(const struct sk_buff *skb,
|
||||
const struct xt_match_param *par)
|
||||
{
|
||||
struct xtnu_match *nm = xtcompat_numatch(par->match);
|
||||
struct xt_action_param local_par;
|
||||
|
||||
local_par.in = par->in;
|
||||
local_par.out = par->out;
|
||||
local_par.match = par->match;
|
||||
local_par.matchinfo = par->matchinfo;
|
||||
local_par.fragoff = par->fragoff;
|
||||
local_par.thoff = par->thoff;
|
||||
local_par.hotdrop = par->hotdrop;
|
||||
local_par.family = par->family;
|
||||
|
||||
if (nm == NULL || nm->match == NULL)
|
||||
return false;
|
||||
return nm->match(skb, &local_par);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
|
||||
static int xtnu_match_check(const char *table, const void *entry,
|
||||
@@ -144,6 +165,10 @@ int xtnu_register_match(struct xtnu_match *nt)
|
||||
ct->match = xtnu_match_run;
|
||||
ct->checkentry = xtnu_match_check;
|
||||
ct->destroy = xtnu_match_destroy;
|
||||
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||
ct->match = xtnu_match_run;
|
||||
ct->checkentry = xtnu_match_check;
|
||||
ct->destroy = nt->destroy;
|
||||
#else
|
||||
ct->match = nt->match;
|
||||
ct->checkentry = xtnu_match_check;
|
||||
@@ -211,14 +236,14 @@ static unsigned int xtnu_target_run(struct sk_buff *skb,
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
||||
{
|
||||
struct xtnu_target *nt = xtcompat_nutarget(ct);
|
||||
struct xt_target_param local_par = {
|
||||
.in = in,
|
||||
.out = out,
|
||||
.hooknum = hooknum,
|
||||
.target = ct,
|
||||
.targinfo = targinfo,
|
||||
.family = NFPROTO_UNSPEC,
|
||||
};
|
||||
struct xt_action_param local_par;
|
||||
|
||||
local_par.in = in;
|
||||
local_par.out = out;
|
||||
local_par.hooknum = hooknum;
|
||||
local_par.target = ct;
|
||||
local_par.targinfo = targinfo;
|
||||
local_par.family = NFPROTO_UNSPEC;
|
||||
|
||||
if (nt != NULL && nt->target != NULL)
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
|
||||
@@ -235,7 +260,16 @@ static unsigned int
|
||||
xtnu_target_run(struct sk_buff *skb, const struct xt_target_param *par)
|
||||
{
|
||||
struct xtnu_target *nt = xtcompat_nutarget(par->target);
|
||||
return nt->target(&skb, par);
|
||||
struct xt_action_param local_par;
|
||||
|
||||
local_par.in = par->in;
|
||||
local_par.out = par->out;
|
||||
local_par.hooknum = par->hooknum;
|
||||
local_par.target = par->target;
|
||||
local_par.targinfo = par->targinfo;
|
||||
local_par.family = par->family;
|
||||
|
||||
return nt->target(&skb, &local_par);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user