mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 21:54:57 +02:00
build: remove support for Linux 2.6.27
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
HEAD
|
HEAD
|
||||||
====
|
====
|
||||||
Changes:
|
Changes:
|
||||||
- remove support for Linux 2.6.17--2.6.26
|
- remove support for Linux 2.6.17--2.6.27
|
||||||
|
|
||||||
|
|
||||||
v1.47.1 (2010-10-15)
|
v1.47.1 (2010-10-15)
|
||||||
|
@@ -30,31 +30,6 @@
|
|||||||
# define WITH_IPV6 1
|
# define WITH_IPV6 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
|
||||||
static bool xtnu_match_run(const struct sk_buff *skb,
|
|
||||||
const struct net_device *in, const struct net_device *out,
|
|
||||||
const struct xt_match *cm, const void *matchinfo, int offset,
|
|
||||||
unsigned int protoff, bool *hotdrop)
|
|
||||||
{
|
|
||||||
struct xtnu_match *nm = xtcompat_numatch(cm);
|
|
||||||
bool lo_ret;
|
|
||||||
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 = false;
|
|
||||||
local_par.family = NFPROTO_UNSPEC; /* don't have that info */
|
|
||||||
|
|
||||||
if (nm == NULL || nm->match == NULL)
|
|
||||||
return false;
|
|
||||||
lo_ret = nm->match(skb, &local_par);
|
|
||||||
*hotdrop = local_par.hotdrop;
|
|
||||||
return lo_ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
||||||
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
static bool xtnu_match_run(const struct sk_buff *skb,
|
static bool xtnu_match_run(const struct sk_buff *skb,
|
||||||
@@ -81,27 +56,6 @@ static bool xtnu_match_run(const struct sk_buff *skb,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
|
||||||
static bool xtnu_match_check(const char *table, const void *entry,
|
|
||||||
const struct xt_match *cm, void *matchinfo, unsigned int hook_mask)
|
|
||||||
{
|
|
||||||
struct xtnu_match *nm = xtcompat_numatch(cm);
|
|
||||||
struct xt_mtchk_param local_par = {
|
|
||||||
.table = table,
|
|
||||||
.entryinfo = entry,
|
|
||||||
.match = cm,
|
|
||||||
.matchinfo = matchinfo,
|
|
||||||
.hook_mask = hook_mask,
|
|
||||||
.family = NFPROTO_UNSPEC,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (nm == NULL)
|
|
||||||
return false;
|
|
||||||
if (nm->checkentry == NULL)
|
|
||||||
return true;
|
|
||||||
return nm->checkentry(&local_par) == 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
||||||
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
static bool xtnu_match_check(const struct xt_mtchk_param *par)
|
static bool xtnu_match_check(const struct xt_mtchk_param *par)
|
||||||
@@ -116,23 +70,6 @@ static bool xtnu_match_check(const struct xt_mtchk_param *par)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
|
||||||
static void xtnu_match_destroy(const struct xt_match *cm, void *matchinfo)
|
|
||||||
#endif
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
|
||||||
{
|
|
||||||
struct xtnu_match *nm = xtcompat_numatch(cm);
|
|
||||||
struct xt_mtdtor_param local_par = {
|
|
||||||
.match = cm,
|
|
||||||
.matchinfo = matchinfo,
|
|
||||||
.family = NFPROTO_UNSPEC,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (nm != NULL && nm->destroy != NULL)
|
|
||||||
nm->destroy(&local_par);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
int xtnu_register_match(struct xtnu_match *nt)
|
int xtnu_register_match(struct xtnu_match *nt)
|
||||||
{
|
{
|
||||||
@@ -155,11 +92,7 @@ int xtnu_register_match(struct xtnu_match *nt)
|
|||||||
ct->table = (char *)nt->table;
|
ct->table = (char *)nt->table;
|
||||||
ct->hooks = nt->hooks;
|
ct->hooks = nt->hooks;
|
||||||
ct->proto = nt->proto;
|
ct->proto = nt->proto;
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
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->match = xtnu_match_run;
|
||||||
ct->checkentry = xtnu_match_check;
|
ct->checkentry = xtnu_match_check;
|
||||||
ct->destroy = nt->destroy;
|
ct->destroy = nt->destroy;
|
||||||
@@ -213,26 +146,6 @@ void xtnu_unregister_matches(struct xtnu_match *nt, unsigned int num)
|
|||||||
EXPORT_SYMBOL_GPL(xtnu_unregister_matches);
|
EXPORT_SYMBOL_GPL(xtnu_unregister_matches);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
|
||||||
static unsigned int xtnu_target_run(struct sk_buff *skb,
|
|
||||||
const struct net_device *in, const struct net_device *out,
|
|
||||||
unsigned int hooknum, const struct xt_target *ct, const void *targinfo)
|
|
||||||
{
|
|
||||||
struct xtnu_target *nt = xtcompat_nutarget(ct);
|
|
||||||
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)
|
|
||||||
return nt->target(&skb, &local_par);
|
|
||||||
return XT_CONTINUE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
||||||
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
static unsigned int
|
static unsigned int
|
||||||
@@ -261,29 +174,6 @@ xtnu_target_run(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
|
||||||
static bool xtnu_target_check(const char *table, const void *entry,
|
|
||||||
const struct xt_target *ct, void *targinfo, unsigned int hook_mask)
|
|
||||||
{
|
|
||||||
struct xtnu_target *nt = xtcompat_nutarget(ct);
|
|
||||||
struct xt_tgchk_param local_par = {
|
|
||||||
.table = table,
|
|
||||||
.entryinfo = entry,
|
|
||||||
.target = ct,
|
|
||||||
.targinfo = targinfo,
|
|
||||||
.hook_mask = hook_mask,
|
|
||||||
.family = NFPROTO_UNSPEC,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (nt == NULL)
|
|
||||||
return false;
|
|
||||||
if (nt->checkentry == NULL)
|
|
||||||
/* this is valid, just like if there was no function */
|
|
||||||
return true;
|
|
||||||
return nt->checkentry(&local_par) == 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
||||||
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
static bool xtnu_target_check(const struct xt_tgchk_param *par)
|
static bool xtnu_target_check(const struct xt_tgchk_param *par)
|
||||||
@@ -298,21 +188,6 @@ static bool xtnu_target_check(const struct xt_tgchk_param *par)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
|
||||||
static void xtnu_target_destroy(const struct xt_target *ct, void *targinfo)
|
|
||||||
{
|
|
||||||
struct xtnu_target *nt = xtcompat_nutarget(ct);
|
|
||||||
struct xt_tgdtor_param local_par = {
|
|
||||||
.target = ct,
|
|
||||||
.targinfo = targinfo,
|
|
||||||
.family = NFPROTO_UNSPEC,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (nt != NULL && nt->destroy != NULL)
|
|
||||||
nt->destroy(&local_par);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int xtnu_register_target(struct xtnu_target *nt)
|
int xtnu_register_target(struct xtnu_target *nt)
|
||||||
{
|
{
|
||||||
struct xt_target *ct;
|
struct xt_target *ct;
|
||||||
@@ -335,10 +210,7 @@ int xtnu_register_target(struct xtnu_target *nt)
|
|||||||
ct->hooks = nt->hooks;
|
ct->hooks = nt->hooks;
|
||||||
ct->proto = nt->proto;
|
ct->proto = nt->proto;
|
||||||
ct->target = xtnu_target_run;
|
ct->target = xtnu_target_run;
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
ct->checkentry = xtnu_target_check;
|
|
||||||
ct->destroy = xtnu_target_destroy;
|
|
||||||
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
|
||||||
ct->checkentry = xtnu_target_check;
|
ct->checkentry = xtnu_target_check;
|
||||||
ct->destroy = nt->destroy;
|
ct->destroy = nt->destroy;
|
||||||
#else
|
#else
|
||||||
|
@@ -11,56 +11,6 @@ struct net_device;
|
|||||||
struct rtable;
|
struct rtable;
|
||||||
struct sk_buff;
|
struct sk_buff;
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
|
||||||
enum {
|
|
||||||
NFPROTO_UNSPEC = 0,
|
|
||||||
NFPROTO_IPV4 = 2,
|
|
||||||
NFPROTO_ARP = 3,
|
|
||||||
NFPROTO_BRIDGE = 7,
|
|
||||||
NFPROTO_IPV6 = 10,
|
|
||||||
NFPROTO_DECNET = 12,
|
|
||||||
NFPROTO_NUMPROTO,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_mtchk_param {
|
|
||||||
const char *table;
|
|
||||||
const void *entryinfo;
|
|
||||||
const struct xt_match *match;
|
|
||||||
void *matchinfo;
|
|
||||||
unsigned int hook_mask;
|
|
||||||
u_int8_t family;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_mtdtor_param {
|
|
||||||
const struct xt_match *match;
|
|
||||||
void *matchinfo;
|
|
||||||
u_int8_t family;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_target_param {
|
|
||||||
const struct net_device *in, *out;
|
|
||||||
unsigned int hooknum;
|
|
||||||
const struct xt_target *target;
|
|
||||||
const void *targinfo;
|
|
||||||
u_int8_t family;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_tgchk_param {
|
|
||||||
const char *table;
|
|
||||||
const void *entryinfo;
|
|
||||||
const struct xt_target *target;
|
|
||||||
void *targinfo;
|
|
||||||
unsigned int hook_mask;
|
|
||||||
u_int8_t family;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct xt_tgdtor_param {
|
|
||||||
const struct xt_target *target;
|
|
||||||
void *targinfo;
|
|
||||||
u_int8_t family;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
struct xt_action_param {
|
struct xt_action_param {
|
||||||
union {
|
union {
|
||||||
|
@@ -56,10 +56,7 @@ xt_chaos_total(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
bool ret;
|
bool ret;
|
||||||
bool hotdrop = false;
|
bool hotdrop = false;
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
ret = xm_tcp->match(skb, par->in, par->out, xm_tcp, &tcp_params,
|
|
||||||
fragoff, thoff, &hotdrop);
|
|
||||||
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
|
||||||
{
|
{
|
||||||
struct xt_match_param local_par = {
|
struct xt_match_param local_par = {
|
||||||
.in = par->in,
|
.in = par->in,
|
||||||
@@ -90,9 +87,7 @@ xt_chaos_total(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
destiny = (info->variant == XTCHAOS_TARPIT) ? xt_tarpit : xt_delude;
|
destiny = (info->variant == XTCHAOS_TARPIT) ? xt_tarpit : xt_delude;
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
destiny->target(skb, par->in, par->out, par->hooknum, destiny, NULL);
|
|
||||||
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
|
||||||
{
|
{
|
||||||
struct xt_target_param local_par = {
|
struct xt_target_param local_par = {
|
||||||
.in = par->in,
|
.in = par->in,
|
||||||
@@ -134,10 +129,7 @@ chaos_tg(struct sk_buff **pskb, const struct xt_action_param *par)
|
|||||||
const struct iphdr *iph = ip_hdr(skb);
|
const struct iphdr *iph = ip_hdr(skb);
|
||||||
|
|
||||||
if ((unsigned int)net_random() <= reject_percentage) {
|
if ((unsigned int)net_random() <= reject_percentage) {
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||||
return xt_reject->target(skb, par->in, par->out, par->hooknum,
|
|
||||||
xt_reject, &reject_params);
|
|
||||||
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
|
||||||
struct xt_target_param local_par = {
|
struct xt_target_param local_par = {
|
||||||
.in = par->in,
|
.in = par->in,
|
||||||
.out = par->out,
|
.out = par->out,
|
||||||
|
Reference in New Issue
Block a user