summaryrefslogtreecommitdiffstats
path: root/kernel/net/netfilter/ipset/ip_set_getport.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2013-10-02 17:31:15 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2013-10-02 17:31:15 +0200
commit8a82b39ef90b95cd4533fb5a6f5afa2b74ebd61d (patch)
tree0dc92ad0e77247ae87823a3c3f18cb34f36abc78 /kernel/net/netfilter/ipset/ip_set_getport.c
parenta61d7ebe47c4c0d7a60dd8d4345ef4e41f14426a (diff)
Compatibility code is modified not to rely on kernel version numbers
Instead the kernel source code is checked to verify the different compatibility issues for the supported kernel releases. This way hopefully backported features will be handled properly.
Diffstat (limited to 'kernel/net/netfilter/ipset/ip_set_getport.c')
-rw-r--r--kernel/net/netfilter/ipset/ip_set_getport.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_getport.c b/kernel/net/netfilter/ipset/ip_set_getport.c
index a0d96eb..5d5ff82 100644
--- a/kernel/net/netfilter/ipset/ip_set_getport.c
+++ b/kernel/net/netfilter/ipset/ip_set_getport.c
@@ -8,7 +8,7 @@
/* Get Layer-4 data from the packets */
#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
+#ifdef HAVE_EXPORT_H
#include <linux/export.h>
#endif
#include <linux/ip.h>
@@ -21,6 +21,7 @@
#include <net/ipv6.h>
#include <linux/netfilter/ipset/ip_set_getport.h>
+#include <linux/netfilter/ipset/ip_set_compat.h>
/* We must handle non-linear skbs */
static bool
@@ -138,7 +139,7 @@ ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
__be16 frag_off = 0;
nexthdr = ipv6_hdr(skb)->nexthdr;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
+#if HAVE_IPV6_SKIP_EXTHDR_ARGS == 4
protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr,
&frag_off);
#else