]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
build: remove support for Linux 2.6.23
authorJan Engelhardt <jengelh@inai.de>
Mon, 15 Oct 2012 21:55:30 +0000 (23:55 +0200)
committerJan Engelhardt <jengelh@inai.de>
Tue, 16 Oct 2012 02:16:56 +0000 (04:16 +0200)
12 files changed:
doc/changelog.txt
extensions/compat_rawpost.h
extensions/compat_xtables.c
extensions/compat_xtables.h
extensions/pknock/xt_pknock.c
extensions/xt_CHAOS.c
extensions/xt_SYSRQ.c
extensions/xt_TEE.c
extensions/xt_condition.c
extensions/xt_iface.c
extensions/xt_lscan.c
extensions/xt_quota2.c

index f9a75b7a2f6b893edac297541c5dd3c0b074e938..1c52c4581732bb72687b34c6b6f238308fb925ae 100644 (file)
@@ -2,7 +2,7 @@
 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)
index 20554d22440fa233867bfb839d92f30fc8b9baf7..0221c8b7d71000f48273521539bee89ce97cc2bb 100644 (file)
@@ -1,10 +1,6 @@
 #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 */
index ced1e7772407ea86c706d1f84ed880f77365529d..c1f4d83bca2ec92f0a73eb3f2c2f869fa164792f 100644 (file)
@@ -213,16 +213,10 @@ void xtnu_unregister_matches(struct xtnu_match *nt, unsigned int num)
 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;
@@ -235,11 +229,7 @@ static unsigned int xtnu_target_run(struct sk_buff *skb,
        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
@@ -425,21 +415,13 @@ EXPORT_SYMBOL_GPL(xtnu_request_find_match);
 
 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);
 
@@ -465,28 +447,6 @@ int xtnu_ip_local_out(struct sk_buff *skb)
        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)
index 3d2affb62736ba7613393b6755446897d78246cf..142b0b0d61dc87fda9fd593c17eb4d7f1aeada64 100644 (file)
@@ -8,8 +8,8 @@
 
 #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
index f0026ea15674a29298614caf7af8c02846fca01f..3e0343997ea3c7a9d043e11f0c939f60249b52a7 100644 (file)
@@ -776,9 +776,7 @@ has_secret(const unsigned char *secret, unsigned int secret_len, uint32_t ipsrc,
 
        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));
 
@@ -1150,7 +1148,7 @@ static int __init xt_pknock_mt_init(void)
        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;
@@ -1160,7 +1158,7 @@ static int __init xt_pknock_mt_init(void)
 
 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)
index 01a63a6a37784396c94e60948207242fd5a74ec3..b9a163916b05d4ca1d9fce0fd6f7b20538700e46 100644 (file)
@@ -90,9 +90,7 @@ xt_chaos_total(struct sk_buff *skb, const struct xt_action_param *par)
                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)
        {
@@ -136,10 +134,7 @@ chaos_tg(struct sk_buff **pskb, const struct xt_action_param *par)
        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)
index ab17bd8301fd7cda5241fcdf3d38f25c7f923cd9..3c081785f685e9915aac6c138397974859705b4b 100644 (file)
@@ -119,9 +119,7 @@ static unsigned int sysrq_tg(const void *pdata, uint16_t len)
        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);
index 791a8fa20df6601fa0ff74b6032cc1b31ba711d7..636bf7caf28e68c1c0ba7027ec0bedfdfb3977f3 100644 (file)
@@ -67,11 +67,7 @@ tee_tg_route4(struct sk_buff *skb, const struct xt_tee_tginfo *info)
 
 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
 }
 
 /*
index 24f43c93487557e8911c481c89ee8b32cf64af82..f16bce02477ba9d2e9fc11f5994280850c9dc82e 100644 (file)
@@ -211,13 +211,13 @@ static int __init condition_mt_init(void)
        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;
        }
 
@@ -227,7 +227,7 @@ static int __init condition_mt_init(void)
 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);
index fe3c061fe73938a149d52fe7b60654d7f84f3a5c..030a6448cd5e797c805a197f95a37526fcc8084f 100644 (file)
@@ -48,11 +48,7 @@ static const struct net_device *iface_get(const struct xt_iface_mtinfo *info,
                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,
index dadf067b07987855c7fb996ee162b5ab259dfe7b..14f3b2b297f90ecc1877eefc5900c2d3dc9091a0 100644 (file)
@@ -204,7 +204,7 @@ lscan_mt(const struct sk_buff *skb, struct xt_action_param *par)
                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;
index d74ba241108c6d6ede35247e7cb798c392ae4627..98fce707b3898692443f49c97f8ef4816ce1c8d1 100644 (file)
@@ -250,20 +250,20 @@ static int __init quota_mt2_init(void)
 {
        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);