]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
compat: compile fixes for 2.6.29
authorJan Engelhardt <jengelh@medozas.de>
Wed, 11 Feb 2009 14:56:33 +0000 (15:56 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Wed, 11 Feb 2009 14:56:33 +0000 (15:56 +0100)
2.6.29 removes at least NIP6, and NIPQUAD is scheduled to follow.

extensions/compat_xtables.h

index c0c64702072932a8acbe3edc78d97f6f0b7ec1a7..8456550b6744d426c7ca265a619eb6034d693941 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _XTABLES_COMPAT_H
 #define _XTABLES_COMPAT_H 1
 
+#include <linux/kernel.h>
 #include <linux/version.h>
 #include "compat_skbuff.h"
 #include "compat_xtnu.h"
 #      define csum_replace2 nf_csum_replace2
 #endif
 
+#if !defined(NIP6) && !defined(NIP6_FMT)
+#      define NIP6(addr) \
+               ntohs((addr).s6_addr16[0]), \
+               ntohs((addr).s6_addr16[1]), \
+               ntohs((addr).s6_addr16[2]), \
+               ntohs((addr).s6_addr16[3]), \
+               ntohs((addr).s6_addr16[4]), \
+               ntohs((addr).s6_addr16[5]), \
+               ntohs((addr).s6_addr16[6]), \
+               ntohs((addr).s6_addr16[7])
+#      define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
+#endif
+#if !defined(NIPQUAD) && !defined(NIPQUAD_FMT)
+#      define NIPQUAD(addr) \
+               ((const unsigned char *)&addr)[0], \
+               ((const unsigned char *)&addr)[1], \
+               ((const unsigned char *)&addr)[2], \
+               ((const unsigned char *)&addr)[3]
+#      define NIPQUAD_FMT "%u.%u.%u.%u"
+#endif
+
 #define ip_route_me_harder    xtnu_ip_route_me_harder
 #define skb_make_writable     xtnu_skb_make_writable
 #define xt_target             xtnu_target