HEAD
====
Changes:
-- remove support for Linux 2.6.17--2.6.22
+- remove support for Linux 2.6.17--2.6.23
v1.47.1 (2010-10-15)
#ifndef XTA_COMPAT_RAWPOST_H
#define XTA_COMPAT_RAWPOST_H 1
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
typedef struct sk_buff sk_buff_t;
-#else
-typedef struct sk_buff *sk_buff_t;
-#endif
#endif /* XTA_COMPAT_RAWPOST_H */
EXPORT_SYMBOL_GPL(xtnu_unregister_matches);
#endif
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
-static unsigned int xtnu_target_run(struct sk_buff **pskb,
- const struct net_device *in, const struct net_device *out,
- unsigned int hooknum, const struct xt_target *ct, const void *targinfo)
-#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
+#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)
-#endif
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
{
struct xtnu_target *nt = xtcompat_nutarget(ct);
struct xt_action_param local_par;
local_par.family = NFPROTO_UNSPEC;
if (nt != NULL && nt->target != NULL)
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
- return nt->target(pskb, &local_par);
-#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
return nt->target(&skb, &local_par);
-#endif
return XT_CONTINUE;
}
#endif
int xtnu_ip_route_me_harder(struct sk_buff **pskb, unsigned int addr_type)
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
- return ip_route_me_harder(pskb, addr_type);
-#else
return ip_route_me_harder(*pskb, addr_type);
-#endif
}
EXPORT_SYMBOL_GPL(xtnu_ip_route_me_harder);
int xtnu_skb_make_writable(struct sk_buff **pskb, unsigned int len)
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
- return skb_make_writable(pskb, len);
-#else
return skb_make_writable(*pskb, len);
-#endif
}
EXPORT_SYMBOL_GPL(xtnu_skb_make_writable);
return err;
}
EXPORT_SYMBOL_GPL(xtnu_ip_local_out);
-#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
-static int __xtnu_ip_local_out(struct sk_buff **pskb)
-{
- struct iphdr *iph = ip_hdr(*pskb);
-
- iph->tot_len = htons((*pskb)->len);
- ip_send_check(iph);
- return nf_hook(PF_INET, NF_IP_LOCAL_OUT, pskb, NULL,
- (*pskb)->dst->dev, dst_output);
-}
-
-int xtnu_ip_local_out(struct sk_buff *skb)
-{
- int err;
-
- err = __xtnu_ip_local_out(&skb);
- if (likely(err == 1))
- err = dst_output(skb);
-
- return err;
-}
-EXPORT_SYMBOL_GPL(xtnu_ip_local_out);
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 24)
#define DEBUGP Use__pr_debug__instead
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
-# warning Kernels below 2.6.23 not supported.
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
+# warning Kernels below 2.6.24 not supported.
#endif
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
# include "compat_nfinetaddr.h"
#endif
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
-# define init_net xtnu_ip_route_output_key /* yes */
-# define init_net__loopback_dev (&loopback_dev)
-# define init_net__proc_net proc_net
-#else
-# define init_net__loopback_dev init_net.loopback_dev
-# define init_net__proc_net init_net.proc_net
-#endif
-
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
# define xt_match xtnu_match
# define xt_register_match xtnu_register_match
epoch_min = get_seconds() / 60;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
sg_init_table(sg, ARRAY_SIZE(sg));
-#endif
sg_set_buf(&sg[0], &ipsrc, sizeof(ipsrc));
sg_set_buf(&sg[1], &epoch_min, sizeof(epoch_min));
crypto.desc.tfm = crypto.tfm;
crypto.desc.flags = 0;
- pde = proc_mkdir("xt_pknock", init_net__proc_net);
+ pde = proc_mkdir("xt_pknock", init_net.proc_net);
if (pde == NULL) {
printk(KERN_ERR PKNOCK "proc_mkdir() error in _init().\n");
return -ENXIO;
static void __exit xt_pknock_mt_exit(void)
{
- remove_proc_entry("xt_pknock", init_net__proc_net);
+ remove_proc_entry("xt_pknock", init_net.proc_net);
xt_unregister_match(&xt_pknock_mt_reg);
kfree(rule_hashtable);
if (crypto.tfm != NULL)
return;
destiny = (info->variant == XTCHAOS_TARPIT) ? xt_tarpit : xt_delude;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
- destiny->target(&skb, par->in, par->out, par->hooknum, destiny, NULL);
-#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
destiny->target(skb, par->in, par->out, par->hooknum, destiny, NULL);
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
{
const struct iphdr *iph = ip_hdr(skb);
if ((unsigned int)net_random() <= reject_percentage) {
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
- return xt_reject->target(pskb, par->in, par->out, par->hooknum,
- xt_reject, &reject_params);
-#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 27)
return xt_reject->target(skb, par->in, par->out, par->hooknum,
xt_reject, &reject_params);
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 34)
ret = crypto_hash_init(&desc);
if (ret != 0)
goto hash_fail;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
sg_init_table(sg, 2);
-#endif
sg_set_buf(&sg[0], data, n);
i = strlen(sysrq_digest_password);
sg_set_buf(&sg[1], sysrq_digest_password, i);
static inline bool dev_hh_avail(const struct net_device *dev)
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 23)
- return dev->hard_header != NULL;
-#else
return dev->header_ops != NULL;
-#endif
}
/*
int ret;
mutex_init(&proc_lock);
- proc_net_condition = proc_mkdir(dir_name, init_net__proc_net);
+ proc_net_condition = proc_mkdir(dir_name, init_net.proc_net);
if (proc_net_condition == NULL)
return -EACCES;
ret = xt_register_matches(condition_mt_reg, ARRAY_SIZE(condition_mt_reg));
if (ret < 0) {
- remove_proc_entry(dir_name, init_net__proc_net);
+ remove_proc_entry(dir_name, init_net.proc_net);
return ret;
}
static void __exit condition_mt_exit(void)
{
xt_unregister_matches(condition_mt_reg, ARRAY_SIZE(condition_mt_reg));
- remove_proc_entry(dir_name, init_net__proc_net);
+ remove_proc_entry(dir_name, init_net.proc_net);
}
module_init(condition_mt_init);
return par->in;
else if (info->flags & XT_IFACE_DEV_OUT)
return par->out;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
return *put = dev_get_by_name(&init_net, info->ifname);
-#else
- return *put = dev_get_by_name(info->ifname);
-#endif
}
static bool iface_flagtest(unsigned int devflags, unsigned int flags,
unsigned int n;
n = lscan_mt_full(ctdata->mark & connmark_mask, ctstate,
- par->in == init_net__loopback_dev, tcph,
+ par->in == init_net.loopback_dev, tcph,
skb->len - par->thoff - 4 * tcph->doff);
ctdata->mark = (ctdata->mark & ~connmark_mask) | n;
{
int ret;
- proc_xt_quota = proc_mkdir("xt_quota", init_net__proc_net);
+ proc_xt_quota = proc_mkdir("xt_quota", init_net.proc_net);
if (proc_xt_quota == NULL)
return -EACCES;
ret = xt_register_matches(quota_mt2_reg, ARRAY_SIZE(quota_mt2_reg));
if (ret < 0)
- remove_proc_entry("xt_quota", init_net__proc_net);
+ remove_proc_entry("xt_quota", init_net.proc_net);
return ret;
}
static void __exit quota_mt2_exit(void)
{
xt_unregister_matches(quota_mt2_reg, ARRAY_SIZE(quota_mt2_reg));
- remove_proc_entry("xt_quota", init_net__proc_net);
+ remove_proc_entry("xt_quota", init_net.proc_net);
}
module_init(quota_mt2_init);