mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 05:05:12 +02:00
compat_xtables: move to 2.6.35 API for targets
This commit is contained in:
@@ -84,6 +84,19 @@ static bool xtnu_match_check(const char *table, const void *entry,
|
||||
return nm->checkentry(&local_par);
|
||||
}
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
||||
LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
|
||||
static bool xtnu_match_check(const struct xt_mtchk_param *par)
|
||||
{
|
||||
struct xtnu_match *nm = xtcompat_numatch(cm);
|
||||
|
||||
if (nm == NULL)
|
||||
return false;
|
||||
if (nm->checkentry == NULL)
|
||||
return true;
|
||||
return nm->checkentry(par) == 0 ? true : false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
|
||||
@@ -264,6 +277,20 @@ static bool xtnu_target_check(const char *table, const void *entry,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
|
||||
static bool xtnu_target_check(const struct xt_tgchk_param *par)
|
||||
{
|
||||
struct xtnu_target *nt = xtcompat_nutarget(cm);
|
||||
|
||||
if (nt == NULL)
|
||||
return false;
|
||||
if (nt->checkentry == NULL)
|
||||
return true;
|
||||
return nt->checkentry(par) == 0 ? true : false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
|
||||
static void xtnu_target_destroy(const struct xt_target *ct, void *targinfo,
|
||||
unsigned int targinfosize)
|
||||
@@ -306,7 +333,7 @@ int xtnu_register_target(struct xtnu_target *nt)
|
||||
ct->hooks = nt->hooks;
|
||||
ct->proto = nt->proto;
|
||||
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;
|
||||
#else
|
||||
|
Reference in New Issue
Block a user