mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-07 05:05:12 +02:00
build: remove support for Linux 4.9
This commit is contained in:
@@ -59,7 +59,7 @@ if test -n "$kbuilddir"; then
|
|||||||
echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
|
echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
|
||||||
if test "$kmajor" -gt 4 -o "$kmajor" -eq 4 -a "$kminor" -gt 12; then
|
if test "$kmajor" -gt 4 -o "$kmajor" -eq 4 -a "$kminor" -gt 12; then
|
||||||
echo "WARNING: That kernel version is not officially supported yet. Continue at own luck.";
|
echo "WARNING: That kernel version is not officially supported yet. Continue at own luck.";
|
||||||
elif test "$kmajor" -eq 4 -a "$kminor" -le 8; then
|
elif test "$kmajor" -eq 4 -a "$kminor" -le 9; then
|
||||||
echo "WARNING: That kernel version is not officially supported.";
|
echo "WARNING: That kernel version is not officially supported.";
|
||||||
elif test "$kmajor" -eq 4 -a "$kminor" -le 10; then
|
elif test "$kmajor" -eq 4 -a "$kminor" -le 10; then
|
||||||
:;
|
:;
|
||||||
|
@@ -4,7 +4,7 @@ HEAD
|
|||||||
Enhancements:
|
Enhancements:
|
||||||
- support for Linux up to 4.15
|
- support for Linux up to 4.15
|
||||||
Changes:
|
Changes:
|
||||||
- remove support for Linux 3.7--4.8
|
- remove support for Linux 3.7--4.9
|
||||||
|
|
||||||
|
|
||||||
v2.14 (2017-11-22)
|
v2.14 (2017-11-22)
|
||||||
|
@@ -482,11 +482,7 @@ static void ipt_acc_depth2_insert(struct ipt_acc_mask_8 *mask_8,
|
|||||||
static unsigned int
|
static unsigned int
|
||||||
ipt_acc_target(struct sk_buff *skb, const struct xt_action_param *par)
|
ipt_acc_target(struct sk_buff *skb, const struct xt_action_param *par)
|
||||||
{
|
{
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
struct ipt_acc_net *ian = net_generic(par->state->net, ipt_acc_net_id);
|
struct ipt_acc_net *ian = net_generic(par->state->net, ipt_acc_net_id);
|
||||||
#else
|
|
||||||
struct ipt_acc_net *ian = net_generic(par->net, ipt_acc_net_id);
|
|
||||||
#endif
|
|
||||||
struct ipt_acc_table *ipt_acc_tables = ian->ipt_acc_tables;
|
struct ipt_acc_table *ipt_acc_tables = ian->ipt_acc_tables;
|
||||||
const struct ipt_acc_info *info =
|
const struct ipt_acc_info *info =
|
||||||
par->targinfo;
|
par->targinfo;
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#define DEBUGP Use__pr_debug__instead
|
#define DEBUGP Use__pr_debug__instead
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||||
# warning Kernels below 4.9 not supported.
|
# warning Kernels below 4.10 not supported.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
|
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
|
||||||
@@ -44,11 +44,7 @@
|
|||||||
|
|
||||||
static inline struct net *par_net(const struct xt_action_param *par)
|
static inline struct net *par_net(const struct xt_action_param *par)
|
||||||
{
|
{
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
|
||||||
return par->state->net;
|
return par->state->net;
|
||||||
#else
|
|
||||||
return par->net;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NF_CT_ASSERT
|
#ifndef NF_CT_ASSERT
|
||||||
|
@@ -58,12 +58,7 @@ xt_chaos_total(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
|
|
||||||
{
|
{
|
||||||
struct xt_action_param local_par;
|
struct xt_action_param local_par;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
local_par.state = par->state;
|
local_par.state = par->state;
|
||||||
#else
|
|
||||||
local_par.in = par->in,
|
|
||||||
local_par.out = par->out,
|
|
||||||
#endif
|
|
||||||
local_par.match = xm_tcp;
|
local_par.match = xm_tcp;
|
||||||
local_par.matchinfo = &tcp_params;
|
local_par.matchinfo = &tcp_params;
|
||||||
local_par.fragoff = fragoff;
|
local_par.fragoff = fragoff;
|
||||||
@@ -78,14 +73,7 @@ xt_chaos_total(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
destiny = (info->variant == XTCHAOS_TARPIT) ? xt_tarpit : xt_delude;
|
destiny = (info->variant == XTCHAOS_TARPIT) ? xt_tarpit : xt_delude;
|
||||||
{
|
{
|
||||||
struct xt_action_param local_par;
|
struct xt_action_param local_par;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
local_par.state = par->state;
|
local_par.state = par->state;
|
||||||
#else
|
|
||||||
local_par.in = par->in;
|
|
||||||
local_par.out = par->out;
|
|
||||||
local_par.hooknum = par->hooknum;
|
|
||||||
local_par.family = par->family;
|
|
||||||
#endif
|
|
||||||
local_par.target = destiny;
|
local_par.target = destiny;
|
||||||
local_par.targinfo = par->targinfo;
|
local_par.targinfo = par->targinfo;
|
||||||
destiny->target(skb, &local_par);
|
destiny->target(skb, &local_par);
|
||||||
@@ -108,27 +96,15 @@ chaos_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
|
|
||||||
if ((unsigned int)prandom_u32() <= reject_percentage) {
|
if ((unsigned int)prandom_u32() <= reject_percentage) {
|
||||||
struct xt_action_param local_par;
|
struct xt_action_param local_par;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
local_par.state = par->state;
|
local_par.state = par->state;
|
||||||
#else
|
|
||||||
local_par.in = par->in;
|
|
||||||
local_par.out = par->out;
|
|
||||||
local_par.hooknum = par->hooknum;
|
|
||||||
#endif
|
|
||||||
local_par.target = xt_reject;
|
local_par.target = xt_reject;
|
||||||
local_par.targinfo = &reject_params;
|
local_par.targinfo = &reject_params;
|
||||||
return xt_reject->target(skb, &local_par);
|
return xt_reject->target(skb, &local_par);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TARPIT/DELUDE may not be called from the OUTPUT chain */
|
/* TARPIT/DELUDE may not be called from the OUTPUT chain */
|
||||||
if (iph->protocol == IPPROTO_TCP &&
|
if (iph->protocol == IPPROTO_TCP && info->variant != XTCHAOS_NORMAL &&
|
||||||
info->variant != XTCHAOS_NORMAL &&
|
par->state->hook != NF_INET_LOCAL_OUT)
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
par->state->hook
|
|
||||||
#else
|
|
||||||
par->hooknum
|
|
||||||
#endif
|
|
||||||
!= NF_INET_LOCAL_OUT)
|
|
||||||
xt_chaos_total(skb, par);
|
xt_chaos_total(skb, par);
|
||||||
|
|
||||||
return NF_DROP;
|
return NF_DROP;
|
||||||
|
@@ -146,13 +146,7 @@ delude_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
* a problem, as that is supported since Linux 2.6.35. But since we do not
|
* a problem, as that is supported since Linux 2.6.35. But since we do not
|
||||||
* actually want to have a connection open, we are still going to drop it.
|
* actually want to have a connection open, we are still going to drop it.
|
||||||
*/
|
*/
|
||||||
delude_send_reset(par_net(par), skb,
|
delude_send_reset(par_net(par), skb, par->state->hook);
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
par->state->hook
|
|
||||||
#else
|
|
||||||
par->hooknum
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
return NF_DROP;
|
return NF_DROP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -356,11 +356,7 @@ out:
|
|||||||
static unsigned int
|
static unsigned int
|
||||||
dnetmap_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
dnetmap_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
||||||
{
|
{
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
struct net *net = dev_net(par->state->in ? par->state->in : par->state->out);
|
struct net *net = dev_net(par->state->in ? par->state->in : par->state->out);
|
||||||
#else
|
|
||||||
struct net *net = dev_net(par->in ? par->in : par->out);
|
|
||||||
#endif
|
|
||||||
struct dnetmap_net *dnetmap_net = dnetmap_pernet(net);
|
struct dnetmap_net *dnetmap_net = dnetmap_pernet(net);
|
||||||
struct nf_conn *ct;
|
struct nf_conn *ct;
|
||||||
enum ip_conntrack_info ctinfo;
|
enum ip_conntrack_info ctinfo;
|
||||||
@@ -371,11 +367,7 @@ dnetmap_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
struct dnetmap_entry *e;
|
struct dnetmap_entry *e;
|
||||||
struct dnetmap_prefix *p;
|
struct dnetmap_prefix *p;
|
||||||
__s32 jttl;
|
__s32 jttl;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
unsigned int hooknum = par->state->hook;
|
unsigned int hooknum = par->state->hook;
|
||||||
#else
|
|
||||||
unsigned int hooknum = par->hooknum;
|
|
||||||
#endif
|
|
||||||
ct = nf_ct_get(skb, &ctinfo);
|
ct = nf_ct_get(skb, &ctinfo);
|
||||||
|
|
||||||
jttl = tginfo->flags & XT_DNETMAP_TTL ? tginfo->ttl * HZ : jtimeout;
|
jttl = tginfo->flags & XT_DNETMAP_TTL ? tginfo->ttl * HZ : jtimeout;
|
||||||
@@ -500,12 +492,7 @@ bind_new_prefix:
|
|||||||
newrange.max_addr.ip = postnat_ip;
|
newrange.max_addr.ip = postnat_ip;
|
||||||
newrange.min_proto = mr->min_proto;
|
newrange.min_proto = mr->min_proto;
|
||||||
newrange.max_proto = mr->max_proto;
|
newrange.max_proto = mr->max_proto;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
return nf_nat_setup_info(ct, &newrange, HOOK2MANIP(par->state->hook));
|
return nf_nat_setup_info(ct, &newrange, HOOK2MANIP(par->state->hook));
|
||||||
#else
|
|
||||||
return nf_nat_setup_info(ct, &newrange, HOOK2MANIP(par->hooknum));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
no_rev_map:
|
no_rev_map:
|
||||||
no_free_ip:
|
no_free_ip:
|
||||||
spin_unlock_bh(&dnetmap_lock);
|
spin_unlock_bh(&dnetmap_lock);
|
||||||
|
@@ -35,11 +35,7 @@ echo_tg6(struct sk_buff *oldskb, const struct xt_action_param *par)
|
|||||||
void *payload;
|
void *payload;
|
||||||
struct flowi6 fl;
|
struct flowi6 fl;
|
||||||
struct dst_entry *dst = NULL;
|
struct dst_entry *dst = NULL;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
struct net *net = dev_net((par->state->in != NULL) ? par->state->in : par->state->out);
|
struct net *net = dev_net((par->state->in != NULL) ? par->state->in : par->state->out);
|
||||||
#else
|
|
||||||
struct net *net = dev_net((par->in != NULL) ? par->in : par->out);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This allows us to do the copy operation in fewer lines of code. */
|
/* This allows us to do the copy operation in fewer lines of code. */
|
||||||
if (skb_linearize(oldskb) < 0)
|
if (skb_linearize(oldskb) < 0)
|
||||||
|
@@ -77,11 +77,7 @@ logmark_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
printk("<%u>%.*s""iif=%d hook=%s nfmark=0x%x "
|
printk("<%u>%.*s""iif=%d hook=%s nfmark=0x%x "
|
||||||
"secmark=0x%x classify=0x%x",
|
"secmark=0x%x classify=0x%x",
|
||||||
info->level, (unsigned int)sizeof(info->prefix), info->prefix,
|
info->level, (unsigned int)sizeof(info->prefix), info->prefix,
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
skb_ifindex(skb), hook_names[par->state->hook],
|
skb_ifindex(skb), hook_names[par->state->hook],
|
||||||
#else
|
|
||||||
skb_ifindex(skb), hook_names[par->hooknum],
|
|
||||||
#endif
|
|
||||||
skb_nfmark(skb), skb_secmark(skb), skb->priority);
|
skb_nfmark(skb), skb_secmark(skb), skb->priority);
|
||||||
|
|
||||||
ct = nf_ct_get(skb, &ctinfo);
|
ct = nf_ct_get(skb, &ctinfo);
|
||||||
|
@@ -431,12 +431,7 @@ tarpit_tg4(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
/* We are not interested in fragments */
|
/* We are not interested in fragments */
|
||||||
if (iph->frag_off & htons(IP_OFFSET))
|
if (iph->frag_off & htons(IP_OFFSET))
|
||||||
return NF_DROP;
|
return NF_DROP;
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
tarpit_tcp4(par_net(par), skb, par->state->hook, info->variant);
|
tarpit_tcp4(par_net(par), skb, par->state->hook, info->variant);
|
||||||
#else
|
|
||||||
tarpit_tcp4(par_net(par), skb, par->hooknum, info->variant);
|
|
||||||
#endif
|
|
||||||
return NF_DROP;
|
return NF_DROP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,12 +472,7 @@ tarpit_tg6(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
pr_debug("addr is not unicast.\n");
|
pr_debug("addr is not unicast.\n");
|
||||||
return NF_DROP;
|
return NF_DROP;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
tarpit_tcp6(par_net(par), skb, par->state->hook, info->variant);
|
tarpit_tcp6(par_net(par), skb, par->state->hook, info->variant);
|
||||||
#else
|
|
||||||
tarpit_tcp6(par_net(par), skb, par->hooknum, info->variant);
|
|
||||||
#endif
|
|
||||||
return NF_DROP;
|
return NF_DROP;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -45,17 +45,9 @@ static const struct net_device *iface_get(const struct xt_iface_mtinfo *info,
|
|||||||
const struct xt_action_param *par, struct net_device **put)
|
const struct xt_action_param *par, struct net_device **put)
|
||||||
{
|
{
|
||||||
if (info->flags & XT_IFACE_DEV_IN)
|
if (info->flags & XT_IFACE_DEV_IN)
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
return par->state->in;
|
return par->state->in;
|
||||||
#else
|
|
||||||
return par->in;
|
|
||||||
#endif
|
|
||||||
else if (info->flags & XT_IFACE_DEV_OUT)
|
else if (info->flags & XT_IFACE_DEV_OUT)
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
return par->state->out;
|
return par->state->out;
|
||||||
#else
|
|
||||||
return par->out;
|
|
||||||
#endif
|
|
||||||
return *put = dev_get_by_name(&init_net, info->ifname);
|
return *put = dev_get_by_name(&init_net, info->ifname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -204,11 +204,7 @@ lscan_mt(const struct sk_buff *skb, struct xt_action_param *par)
|
|||||||
unsigned int n;
|
unsigned int n;
|
||||||
|
|
||||||
n = lscan_mt_full(ctdata->mark & connmark_mask, ctstate,
|
n = lscan_mt_full(ctdata->mark & connmark_mask, ctstate,
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
|
|
||||||
par->state->in == init_net.loopback_dev, tcph,
|
par->state->in == init_net.loopback_dev, tcph,
|
||||||
#else
|
|
||||||
par->in == init_net.loopback_dev, tcph,
|
|
||||||
#endif
|
|
||||||
skb->len - par->thoff - 4 * tcph->doff);
|
skb->len - par->thoff - 4 * tcph->doff);
|
||||||
|
|
||||||
ctdata->mark = (ctdata->mark & ~connmark_mask) | n;
|
ctdata->mark = (ctdata->mark & ~connmark_mask) | n;
|
||||||
|
Reference in New Issue
Block a user