SOURCES (LINUX_2_6): kernel-pom-ng-IPMARK.patch - up from http://p...

arekm arekm at pld-linux.org
Tue Jan 29 09:05:56 CET 2008


Author: arekm                        Date: Tue Jan 29 08:05:56 2008 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- up from http://people.netfilter.org/ole/pom/IPMARK

---- Files affected:
SOURCES:
   kernel-pom-ng-IPMARK.patch (1.1.2.4 -> 1.1.2.5) 

---- Diffs:

================================================================
Index: SOURCES/kernel-pom-ng-IPMARK.patch
diff -u SOURCES/kernel-pom-ng-IPMARK.patch:1.1.2.4 SOURCES/kernel-pom-ng-IPMARK.patch:1.1.2.5
--- SOURCES/kernel-pom-ng-IPMARK.patch:1.1.2.4	Fri Jan 18 15:38:55 2008
+++ SOURCES/kernel-pom-ng-IPMARK.patch	Tue Jan 29 09:05:51 2008
@@ -56,13 +56,13 @@
 diff -NurpP --minimal linux-2.6.21.a/net/ipv4/netfilter/ipt_IPMARK.c linux-2.6.21.b/net/ipv4/netfilter/ipt_IPMARK.c
 --- linux-2.6.21.a/net/ipv4/netfilter/ipt_IPMARK.c	1970-01-01 01:00:00.000000000 +0100
 +++ linux-2.6.21.b/net/ipv4/netfilter/ipt_IPMARK.c	2007-05-30 12:01:21.000000000 +0200
-@@ -0,0 +1,96 @@
+@@ -0,0 +1,125 @@
 +#include <linux/module.h>
 +#include <linux/skbuff.h>
 +#include <linux/version.h>
 +#include <linux/ip.h>
 +#include <net/checksum.h>
-+#include <linux/netfilter/x_tables.h>
++
 +#include <linux/netfilter_ipv4/ip_tables.h>
 +#include <linux/netfilter_ipv4/ipt_IPMARK.h>
 +
@@ -78,11 +78,19 @@
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
 +       const struct xt_target *target,
 +#endif
-+       const void *targinfo
-+       )
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++       const void *targinfo,
++       void *userinfo)
++#else
++       const void *targinfo)
++#endif
 +{
 +	const struct ipt_ipmark_target_info *ipmarkinfo = targinfo;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
 +	struct iphdr *iph = ip_hdr(*pskb);
++#else
++	struct iphdr *iph = (*pskb)->nh.iph;
++#endif
 +	unsigned long mark;
 +
 +	if (ipmarkinfo->addr == IPT_IPMARK_SRC)
@@ -92,10 +100,14 @@
 +
 +	mark &= ipmarkinfo->andmask;
 +	mark |= ipmarkinfo->ormask;
-+	
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
++	if ((*pskb)->nfmark != mark)
++		(*pskb)->nfmark = mark;
++#else
 +	if ((*pskb)->mark != mark)
 +		(*pskb)->mark = mark;
-+
++#endif
 +	return IPT_CONTINUE;
 +}
 +
@@ -110,7 +122,9 @@
 +	   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)
 +{
 +
@@ -131,8 +145,15 @@
 +	return 1;
 +}
 +
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
++static struct xt_target ipt_ipmark_reg = {
++#else
 +static struct ipt_target ipt_ipmark_reg = { 
++#endif
 +	.name		= "IPMARK",
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
++	.family		= AF_INET,
++#endif
 +	.target		= target,
 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
 +	.targetsize	= sizeof(struct ipt_ipmark_target_info),
@@ -143,12 +164,20 @@
 +
 +static int __init init(void)
 +{
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
 +	return xt_register_target(&ipt_ipmark_reg);
++#else
++	return ipt_register_target(&ipt_ipmark_reg);
++#endif
 +}
 +
 +static void __exit fini(void)
 +{
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
 +	xt_unregister_target(&ipt_ipmark_reg);
++#else
++	ipt_unregister_target(&ipt_ipmark_reg);
++#endif
 +}
 +
 +module_init(init);
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-pom-ng-IPMARK.patch?r1=1.1.2.4&r2=1.1.2.5&f=u



More information about the pld-cvs-commit mailing list