[netfilter-cvslog] r3249 - trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter

/C=DE/ST=Berlin/L=Berlin/O=Netfilter /C=DE/ST=Berlin/L=Berlin/O=Netfilter
Thu Oct 21 22:26:17 CEST 2004


Author: /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge at netfilter.org
Date: 2004-10-21 22:26:14 +0200 (Thu, 21 Oct 2004)
New Revision: 3249

Modified:
   trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_conntrack_pptp.c
   trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c
   trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_nat_proto_gre.c
Log:
only expand the l4-part of ip_conntrack_tuple to 32bit instead of 64bit.  This means that the GRE Version and Protocol are no longer stored in the tuple.  Generic GRE conntrack did never work (since the key is not mandatory) anyway.


Modified: trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_conntrack_pptp.c
===================================================================
--- trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_conntrack_pptp.c	2004-10-21 16:34:51 UTC (rev 3248)
+++ trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_conntrack_pptp.c	2004-10-21 20:26:14 UTC (rev 3249)
@@ -178,16 +178,12 @@
 	exp.tuple.src.u.gre.key = htonl(ntohs(peer_callid));
 	exp.tuple.dst.ip = master->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip;
 	exp.tuple.dst.u.gre.key = htonl(ntohs(callid));
-	exp.tuple.dst.u.gre.protocol = __constant_htons(GRE_PROTOCOL_PPTP);
-	exp.tuple.dst.u.gre.version = GRE_VERSION_PPTP;
 	exp.tuple.dst.protonum = IPPROTO_GRE;
 
 	exp.mask.src.ip = 0xffffffff;
 	exp.mask.src.u.all = 0;
 	exp.mask.dst.u.all = 0;
 	exp.mask.dst.u.gre.key = 0xffffffff;
-	exp.mask.dst.u.gre.version = 0xff;
-	exp.mask.dst.u.gre.protocol = 0xffff;
 	exp.mask.dst.ip = 0xffffffff;
 	exp.mask.dst.protonum = 0xffff;
 			

Modified: trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c
===================================================================
--- trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c	2004-10-21 16:34:51 UTC (rev 3248)
+++ trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_conntrack_proto_gre.c	2004-10-21 20:26:14 UTC (rev 3249)
@@ -59,9 +59,7 @@
 		                       ": " format, ## args)
 #define DUMP_TUPLE_GRE(x) printk("%u.%u.%u.%u:0x%x -> %u.%u.%u.%u:0x%x:%u:0x%x\n", \
 			NIPQUAD((x)->src.ip), ntohl((x)->src.u.gre.key), \
-			NIPQUAD((x)->dst.ip), ntohl((x)->dst.u.gre.key), \
-			(x)->dst.u.gre.version, \
-			ntohs((x)->dst.u.gre.protocol))
+			NIPQUAD((x)->dst.ip), ntohl((x)->dst.u.gre.key))
 #else
 #define DEBUGP(x, args...)
 #define DUMP_TUPLE_GRE(x)
@@ -168,9 +166,6 @@
 static int gre_invert_tuple(struct ip_conntrack_tuple *tuple,
 			    const struct ip_conntrack_tuple *orig)
 {
-	tuple->dst.u.gre.protocol = orig->dst.u.gre.protocol;
-	tuple->dst.u.gre.version = orig->dst.u.gre.version;
-
 	tuple->dst.u.gre.key = orig->src.u.gre.key;
 	tuple->src.u.gre.key = orig->dst.u.gre.key;
 
@@ -187,9 +182,6 @@
 
 	/* core guarantees 8 protocol bytes, no need for size check */
 
-	tuple->dst.u.gre.version = grehdr->version; 
-	tuple->dst.u.gre.protocol = grehdr->protocol;
-
 	switch (grehdr->version) {
 		case GRE_VERSION_1701:
 			if (!grehdr->key) {
@@ -209,7 +201,7 @@
 
 		default:
 			printk(KERN_WARNING "unknown GRE version %hu\n",
-				tuple->dst.u.gre.version);
+				grehdr->version);
 			return 0;
 	}
 
@@ -228,9 +220,7 @@
 static unsigned int gre_print_tuple(char *buffer,
 				    const struct ip_conntrack_tuple *tuple)
 {
-	return sprintf(buffer, "version=%d protocol=0x%04x srckey=0x%x dstkey=0x%x ", 
-			tuple->dst.u.gre.version,
-			ntohs(tuple->dst.u.gre.protocol),
+	return sprintf(buffer, "srckey=0x%x dstkey=0x%x ", 
 			ntohl(tuple->src.u.gre.key),
 			ntohl(tuple->dst.u.gre.key));
 }

Modified: trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_nat_proto_gre.c
===================================================================
--- trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_nat_proto_gre.c	2004-10-21 16:34:51 UTC (rev 3248)
+++ trunk/patch-o-matic-ng/pptp-conntrack-nat/linux/net/ipv4/netfilter/ip_nat_proto_gre.c	2004-10-21 20:26:14 UTC (rev 3249)
@@ -77,24 +77,10 @@
 
 	if (!(range->flags & IP_NAT_RANGE_PROTO_SPECIFIED)) {
 
-		switch (tuple->dst.u.gre.version) {
-		case 0:
-			DEBUGP("NATing GRE version 0 (ct=%p)\n",
-				conntrack);
-			min = 1;
-			range_size = 0xffffffff;
-			break;
-		case GRE_VERSION_PPTP:
-			DEBUGP("%p: NATing GRE PPTP\n", 
-				conntrack);
-			min = 1;
-			range_size = 0xffff;
-			break;
-		default:
-			printk(KERN_WARNING "nat_gre: unknown GRE version\n");
-			return 0;
-			break;
-		}
+		DEBUGP("%p: NATing GRE PPTP\n", conntrack);
+		min = 1;
+		range_size = 0xffff;
+		break;
 
 	} else {
 		min = ntohl(range->min.gre.key);
@@ -162,14 +148,6 @@
 {
 	unsigned int len = 0;
 
-	if (mask->dst.u.gre.version)
-		len += sprintf(buffer + len, "version=%d ",
-				ntohs(match->dst.u.gre.version));
-
-	if (mask->dst.u.gre.protocol)
-		len += sprintf(buffer + len, "protocol=0x%x ",
-				ntohs(match->dst.u.gre.protocol));
-
 	if (mask->src.u.gre.key)
 		len += sprintf(buffer + len, "srckey=0x%x ", 
 				ntohl(match->src.u.gre.key));




More information about the netfilter-cvslog mailing list