[netfilter-cvslog] r6724 - in trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net: ipv4/netfilter ipv6/netfilter

kaber at netfilter.org kaber at netfilter.org
Wed Jan 10 07:44:10 CET 2007


Author: kaber at netfilter.org
Date: 2007-01-10 07:44:10 +0100 (Wed, 10 Jan 2007)
New Revision: 6724

Modified:
   trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv4/netfilter/ipt_ROUTE.c
   trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv6/netfilter/Kconfig.ladd
   trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv6/netfilter/ip6t_ROUTE.c
Log:
[POM-NG] ROUTE: 2.6.19 compatibility fix

Make both IPv4 and IPv6 versions compatible with 2.6.19

Signed-off-by: Krzysztof Piotr Oledzki <ole at ans.pl>
Signed-off-by: Patrick McHardy <kaber at trash.net>


Modified: trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv4/netfilter/ipt_ROUTE.c
===================================================================
--- trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv4/netfilter/ipt_ROUTE.c	2007-01-07 19:14:54 UTC (rev 6723)
+++ trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv4/netfilter/ipt_ROUTE.c	2007-01-10 06:44:10 UTC (rev 6724)
@@ -17,6 +17,7 @@
 #include <linux/netfilter_ipv4/ipt_ROUTE.h>
 #include <linux/netdevice.h>
 #include <linux/route.h>
+#include <linux/version.h>
 #include <linux/if_arp.h>
 #include <net/ip.h>
 #include <net/route.h>
@@ -280,9 +281,15 @@
 				     const struct net_device *in,
 				     const struct net_device *out,
 				     unsigned int hooknum,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
 				     const struct xt_target *target,
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
 				     const void *targinfo,
 				     void *userinfo)
+#else
+				     const void *targinfo)
+#endif
 {
 	const struct ipt_route_target_info *route_info = targinfo;
 	struct sk_buff *skb = *pskb;
@@ -401,10 +408,18 @@
 
 
 static int ipt_route_checkentry(const char *tablename,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
 				const void *e,
+#else
+				const struct ipt_ip *ip,
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
 				const struct xt_target *target,
+#endif
 				void *targinfo,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
 				unsigned int targinfosize,
+#endif
 				unsigned int hook_mask)
 {
 	if (strcmp(tablename, "mangle") != 0) {
@@ -422,12 +437,14 @@
 		return 0;
 	}
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
 	if (targinfosize != IPT_ALIGN(sizeof(struct ipt_route_target_info))) {
 		printk(KERN_WARNING "ipt_ROUTE: targinfosize %u != %Zu\n",
 		       targinfosize,
 		       IPT_ALIGN(sizeof(struct ipt_route_target_info)));
 		return 0;
 	}
+#endif
 
 	return 1;
 }
@@ -436,7 +453,9 @@
 static struct ipt_target ipt_route_reg = { 
 	.name = "ROUTE",
 	.target = ipt_route_target,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
 	.targetsize = sizeof(struct ipt_route_target_info),
+#endif
 	.checkentry = ipt_route_checkentry,
 	.me = THIS_MODULE,
 };

Modified: trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv6/netfilter/Kconfig.ladd
===================================================================
--- trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv6/netfilter/Kconfig.ladd	2007-01-07 19:14:54 UTC (rev 6723)
+++ trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv6/netfilter/Kconfig.ladd	2007-01-10 06:44:10 UTC (rev 6724)
@@ -1,5 +1,5 @@
 config IP6_NF_TARGET_ROUTE
-	tristate '    ROUTE target support'
+	tristate 'ROUTE target support'
 	depends on IP6_NF_MANGLE
 	help
 	  This option adds a `ROUTE' target, which enables you to setup unusual

Modified: trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv6/netfilter/ip6t_ROUTE.c
===================================================================
--- trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv6/netfilter/ip6t_ROUTE.c	2007-01-07 19:14:54 UTC (rev 6723)
+++ trunk/patch-o-matic-ng/patchlets/ROUTE/linux-2.6/net/ipv6/netfilter/ip6t_ROUTE.c	2007-01-10 06:44:10 UTC (rev 6724)
@@ -15,6 +15,7 @@
 #include <linux/netfilter_ipv6/ip6_tables.h>
 #include <linux/netfilter_ipv6/ip6t_ROUTE.h>
 #include <linux/netdevice.h>
+#include <linux/version.h>
 #include <net/ipv6.h>
 #include <net/ndisc.h>
 #include <net/ip6_route.h>
@@ -192,9 +193,15 @@
 		  const struct net_device *in,
 		  const struct net_device *out,
 		  unsigned int hooknum,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
 		  const struct xt_target *target,
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
 		  const void *targinfo,
 		  void *userinfo)
+#else
+		  const void *targinfo)
+#endif
 {
 	const struct ip6t_route_target_info *route_info = targinfo;
 	struct sk_buff *skb = *pskb;
@@ -260,10 +267,18 @@
 
 static int 
 ip6t_route_checkentry(const char *tablename,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
 		      const void *entry,
+#else
+		      const struct ip6t_entry *entry
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
 		      const struct xt_target *target,
+#endif
 		      void *targinfo,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
 		      unsigned int targinfosize,
+#endif
 		      unsigned int hook_mask)
 {
 	if (strcmp(tablename, "mangle") != 0) {
@@ -271,12 +286,14 @@
 		return 0;
 	}
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
 	if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_route_target_info))) {
 		printk(KERN_WARNING "ip6t_ROUTE: targinfosize %u != %Zu\n",
 		       targinfosize,
 		       IP6T_ALIGN(sizeof(struct ip6t_route_target_info)));
 		return 0;
 	}
+#endif
 
 	return 1;
 }
@@ -285,7 +302,9 @@
 static struct ip6t_target ip6t_route_reg = {
 	.name       = "ROUTE",
 	.target     = ip6t_route_target,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
 	.targetsize = sizeof(struct ip6t_route_target_info),
+#endif
 	.checkentry = ip6t_route_checkentry,
 	.me         = THIS_MODULE
 };




More information about the netfilter-cvslog mailing list