From 04d8ebe31ccd7d8f078b5a4987cd47951f37ebe3 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 15 Oct 2012 23:55:30 +0200 Subject: [PATCH] build: remove support for Linux 2.6.23 --- doc/changelog.txt | 2 +- extensions/compat_rawpost.h | 4 ---- extensions/compat_xtables.c | 42 +---------------------------------- extensions/compat_xtables.h | 13 ++--------- extensions/pknock/xt_pknock.c | 6 ++--- extensions/xt_CHAOS.c | 9 ++------ extensions/xt_SYSRQ.c | 2 -- extensions/xt_TEE.c | 4 ---- extensions/xt_condition.c | 6 ++--- extensions/xt_iface.c | 4 ---- extensions/xt_lscan.c | 2 +- extensions/xt_quota2.c | 6 ++--- 12 files changed, 15 insertions(+), 85 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index f9a75b7..1c52c45 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -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) diff --git a/extensions/compat_rawpost.h b/extensions/compat_rawpost.h index 20554d2..0221c8b 100644 --- a/extensions/compat_rawpost.h +++ b/extensions/compat_rawpost.h @@ -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 */ diff --git a/extensions/compat_xtables.c b/extensions/compat_xtables.c index ced1e77..c1f4d83 100644 --- a/extensions/compat_xtables.c +++ b/extensions/compat_xtables.c @@ -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) diff --git a/extensions/compat_xtables.h b/extensions/compat_xtables.h index 3d2affb..142b0b0 100644 --- a/extensions/compat_xtables.h +++ b/extensions/compat_xtables.h @@ -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) @@ -32,15 +32,6 @@ # 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 diff --git a/extensions/pknock/xt_pknock.c b/extensions/pknock/xt_pknock.c index f0026ea..3e03439 100644 --- a/extensions/pknock/xt_pknock.c +++ b/extensions/pknock/xt_pknock.c @@ -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) diff --git a/extensions/xt_CHAOS.c b/extensions/xt_CHAOS.c index 01a63a6..b9a1639 100644 --- a/extensions/xt_CHAOS.c +++ b/extensions/xt_CHAOS.c @@ -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) diff --git a/extensions/xt_SYSRQ.c b/extensions/xt_SYSRQ.c index ab17bd8..3c08178 100644 --- a/extensions/xt_SYSRQ.c +++ b/extensions/xt_SYSRQ.c @@ -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); diff --git a/extensions/xt_TEE.c b/extensions/xt_TEE.c index 791a8fa..636bf7c 100644 --- a/extensions/xt_TEE.c +++ b/extensions/xt_TEE.c @@ -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 } /* diff --git a/extensions/xt_condition.c b/extensions/xt_condition.c index 24f43c9..f16bce0 100644 --- a/extensions/xt_condition.c +++ b/extensions/xt_condition.c @@ -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); diff --git a/extensions/xt_iface.c b/extensions/xt_iface.c index fe3c061..030a644 100644 --- a/extensions/xt_iface.c +++ b/extensions/xt_iface.c @@ -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, diff --git a/extensions/xt_lscan.c b/extensions/xt_lscan.c index dadf067..14f3b2b 100644 --- a/extensions/xt_lscan.c +++ b/extensions/xt_lscan.c @@ -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; diff --git a/extensions/xt_quota2.c b/extensions/xt_quota2.c index d74ba24..98fce70 100644 --- a/extensions/xt_quota2.c +++ b/extensions/xt_quota2.c @@ -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);