]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
build: support for Linux 3.5
authorJan Engelhardt <jengelh@inai.de>
Sat, 30 Jun 2012 16:38:49 +0000 (18:38 +0200)
committerJan Engelhardt <jengelh@inai.de>
Sat, 30 Jun 2012 16:38:49 +0000 (18:38 +0200)
doc/changelog.txt
extensions/compat_xtables.c
extensions/compat_xtables.h
extensions/compat_xtnu.h
extensions/xt_RAWNAT.c
extensions/xt_SYSRQ.c
extensions/xt_length2.c

index a2c37df5a37b1660e21cd851ea13d15ed8ccc1b4..4c279fa40b8947cfc300e01a941252c92aee7702 100644 (file)
@@ -5,6 +5,8 @@ Fixes:
 - xt_psd: avoid crash due to curr->next corruption
 Changes:
 - xt_psd: reject invalid match options
+Enhancements:
+- Support for Linux 3.5
 
 
 v1.42 (2012-04-05)
index 26f6a00c5770fc4d2f8d2b49a16edd6415d2dcf9..1a82a5c4168b3b0595017c8e4c65e73651782c5b 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/version.h>
 #include <linux/netfilter_ipv4.h>
 #include <linux/netfilter/x_tables.h>
+#include <linux/netfilter_ipv6/ip6_tables.h>
 #include <linux/netfilter_arp.h>
 #include <net/ip.h>
 #include <net/route.h>
@@ -612,4 +613,12 @@ void *HX_memmem(const void *space, size_t spacesize,
 }
 EXPORT_SYMBOL_GPL(HX_memmem);
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
+int xtnu_ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
+    int target, unsigned short *fragoff, int *fragflg)
+{
+       return ipv6_find_hdr(skb, offset, target, fragoff);
+}
+#endif
+
 MODULE_LICENSE("GPL");
index 06d34b14e4d4ec64a96525a7cb35ff6c2492c115..1af95361033e29d158f2b609f6e1aaf479e2089d 100644 (file)
 #      define NIPQUAD_FMT "%u.%u.%u.%u"
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
+#      define ipv6_find_hdr xtnu_ipv6_find_hdr
+#endif
+
 #define ip_route_me_harder    xtnu_ip_route_me_harder
 #define skb_make_writable     xtnu_skb_make_writable
 #define xt_target             xtnu_target
index 02b657550ba3df71de2772bd6b9379e0856cfeaa..147ad57fb674edabf6992e0fa1ade9e0de83543b 100644 (file)
@@ -162,6 +162,8 @@ extern void xtnu_csum_replace4(__u16 __bitwise *, __be32, __be32);
 extern void xtnu_proto_csum_replace4(__u16 __bitwise *, struct sk_buff *,
        __be32, __be32, bool);
 extern int xtnu_skb_linearize(struct sk_buff *);
+extern int xtnu_ipv6_find_hdr(const struct sk_buff *, unsigned int *,
+       int, unsigned short *, int *);
 
 extern void *HX_memmem(const void *, size_t, const void *, size_t);
 
index 56cfbfa9951825cb13f573024542ff4128a1e12b..bebcfe5afa45cecc3de742ab64e8ed8043096480 100644 (file)
@@ -181,7 +181,7 @@ static bool rawnat6_prepare_l4(struct sk_buff **pskb, unsigned int *l4offset,
        *l4proto = NEXTHDR_MAX;
 
        for (i = 0; i < ARRAY_SIZE(types); ++i) {
-               err = ipv6_find_hdr(*pskb, l4offset, types[i], NULL);
+               err = ipv6_find_hdr(*pskb, l4offset, types[i], NULL, NULL);
                if (err >= 0) {
                        *l4proto = types[i];
                        break;
index 82c0c2e07da1a8a95a6c9125771a28a7244bdc2f..f7c76f0380db05ea2c60a9cea23ed6e9087b3c18 100644 (file)
@@ -247,8 +247,9 @@ sysrq_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
                return NF_DROP;
 
        iph = ipv6_hdr(skb);
-       if ((ipv6_find_hdr(skb, &th_off, IPPROTO_UDP, &frag_off) < 0 &&
-           ipv6_find_hdr(skb, &th_off, IPPROTO_UDPLITE, &frag_off) < 0) ||
+       /* Should probably be using %IP6T_FH_F_AUTH */
+       if ((ipv6_find_hdr(skb, &th_off, IPPROTO_UDP, &frag_off, NULL) < 0 &&
+           ipv6_find_hdr(skb, &th_off, IPPROTO_UDPLITE, &frag_off, NULL) < 0) ||
            frag_off > 0)
                return NF_DROP;
 
index 4b0fcec0e01ce4c95cfa6a41cbc3e30f916a1cf8..2755e2ff70d48d25e97773b977ca7fdaa979cb6f 100644 (file)
@@ -185,7 +185,7 @@ llayer4_proto(const struct sk_buff *skb, unsigned int *offset, bool *hotdrop)
        int err;
 
        for (i = 0; i < ARRAY_SIZE(types); ++i) {
-               err = ipv6_find_hdr(skb, offset, types[i], NULL);
+               err = ipv6_find_hdr(skb, offset, types[i], NULL, NULL);
                if (err >= 0)
                        return types[i];
                if (err != -ENOENT) {