[netfilter-cvslog] r6392 - trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter

kaber at netfilter.org kaber at netfilter.org
Thu Jan 12 07:32:37 CET 2006


Author: kaber at netfilter.org
Date: 2006-01-12 07:32:29 +0100 (Thu, 12 Jan 2006)
New Revision: 6392

Modified:
   trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_conntrack_h323_h225.c
   trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_conntrack_h323_h245.c
   trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_nat_h323.c
Log:
[PATCH]: port h323 helper to the new API in Linux 2.6.13 and 2.6.14 (Max Kellerman)


Modified: trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_conntrack_h323_h225.c
===================================================================
--- trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_conntrack_h323_h225.c	2006-01-12 06:23:57 UTC (rev 6391)
+++ trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_conntrack_h323_h225.c	2006-01-12 06:32:29 UTC (rev 6392)
@@ -108,7 +108,7 @@
 		}
 		if (ret && ip == ct->tuplehash[dir].tuple.src.ip) {
 			/* match found: create an expectation */
-			exp = ip_conntrack_expect_alloc();
+			exp = ip_conntrack_expect_alloc(ct);
 			if (exp == NULL)
 				return NF_ACCEPT;
 
@@ -127,17 +127,20 @@
 
 			/* call NAT hook and register expectation */
 			if (ip_nat_h225_hook != NULL) {
-				return ip_nat_h225_hook(pskb, ctinfo, i,
-							exp);
+				ret = ip_nat_h225_hook(pskb, ctinfo, i,
+						       exp);
 			} else {
 				/* Can't expect this?  Best to drop packet now. */
 				if (ip_conntrack_expect_related(exp) != 0) {
-					ip_conntrack_expect_free(exp);
-					return NF_DROP;
+					ret = NF_DROP;
 				} else {
-					return NF_ACCEPT;
+					ret = NF_ACCEPT;
 				}
 			}
+
+			ip_conntrack_expect_put(exp);
+
+			return ret;
 		}
 	}
 

Modified: trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_conntrack_h323_h245.c
===================================================================
--- trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_conntrack_h323_h245.c	2006-01-12 06:23:57 UTC (rev 6391)
+++ trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_conntrack_h323_h245.c	2006-01-12 06:32:29 UTC (rev 6392)
@@ -296,7 +296,7 @@
 			       NIPQUAD(ip), ntohs(port));
 		if (ret && ip == ct->tuplehash[dir].tuple.src.ip) {
 			/* match found: create an expectation */
-			exp = ip_conntrack_expect_alloc();
+			exp = ip_conntrack_expect_alloc(ct);
 			if (exp == NULL)
 				return NF_ACCEPT;
 
@@ -314,17 +314,20 @@
 
 			/* call NAT hook and register expectation */
 			if (ip_nat_h245_hook != NULL) {
-				return ip_nat_h245_hook(pskb, ctinfo, i,
-							exp);
+				ret = ip_nat_h245_hook(pskb, ctinfo, i, exp);
 			} else {
 				/* Can't expect this?  Best to drop packet now. */
 				if (ip_conntrack_expect_related(exp) != 0) {
-					ip_conntrack_expect_free(exp);
-					return NF_DROP;
+					ret = NF_DROP;
 				} else {
-					return NF_ACCEPT;
+					ret = NF_ACCEPT;
 				}
 			}
+
+			ip_conntrack_expect_put(exp);
+
+			if (ret != NF_ACCEPT)
+				return ret;
 		}
 	}
 
@@ -348,7 +351,7 @@
 			       NIPQUAD(ip), ntohs(port));
 		if (ret && ip == ct->tuplehash[dir].tuple.src.ip) {
 			/* match found: create an expectation */
-			exp = ip_conntrack_expect_alloc();
+			exp = ip_conntrack_expect_alloc(ct);
 			if (exp == NULL)
 				return NF_ACCEPT;
 
@@ -366,17 +369,20 @@
 
 			/* call NAT hook and register expectation */
 			if (ip_nat_h245_hook != NULL) {
-				return ip_nat_h245_hook(pskb, ctinfo, i,
-							exp);
+				ret = ip_nat_h245_hook(pskb, ctinfo, i, exp);
 			} else {
 				/* Can't expect this?  Best to drop packet now. */
 				if (ip_conntrack_expect_related(exp) != 0) {
-					ip_conntrack_expect_free(exp);
-					return NF_DROP;
+					ret = NF_DROP;
 				} else {
-					return NF_ACCEPT;
+					ret = NF_ACCEPT;
 				}
 			}
+
+			ip_conntrack_expect_put(exp);
+
+			if (ret != NF_ACCEPT)
+				return ret;
 		}
 	}
 
@@ -616,7 +622,7 @@
 		       ret, i, ip, port);
 		if (ret && ip == ct->tuplehash[dir].tuple.src.ip) {
 			/* match found: create an expectation */
-			exp = ip_conntrack_expect_alloc();
+			exp = ip_conntrack_expect_alloc(ct);
 			if (exp == NULL)
 				return NF_ACCEPT;
 
@@ -635,17 +641,19 @@
 			/* call NAT hook and register expectation */
 			if (ip_nat_h245_hook != NULL) {
 				ret = ip_nat_h245_hook(pskb, ctinfo, i, exp);
-				if (ret != NF_ACCEPT)
-					return ret;
 			} else {
 				/* Can't expect this?  Best to drop packet now. */
 				if (ip_conntrack_expect_related(exp) != 0) {
-					ip_conntrack_expect_free(exp);
-					return NF_DROP;
+					ret = NF_DROP;
 				} else {
-					return NF_ACCEPT;
+					ret = NF_ACCEPT;
 				}
 			}
+
+			ip_conntrack_expect_put(exp);
+
+			if (ret != NF_ACCEPT)
+				return ret;
 		}
 	}
 
@@ -663,7 +671,7 @@
 		       ret, i, ip, port);
 		if (ret && ip == ct->tuplehash[dir].tuple.src.ip) {
 			/* match found: create an expectation */
-			exp = ip_conntrack_expect_alloc();
+			exp = ip_conntrack_expect_alloc(ct);
 			if (exp == NULL)
 				return NF_ACCEPT;
 
@@ -682,17 +690,19 @@
 			/* call NAT hook and register expectation */
 			if (ip_nat_h245_hook != NULL) {
 				ret = ip_nat_h245_hook(pskb, ctinfo, i, exp);
-				if (ret != NF_ACCEPT)
-					return ret;
 			} else {
 				/* Can't expect this?  Best to drop packet now. */
 				if (ip_conntrack_expect_related(exp) != 0) {
-					ip_conntrack_expect_free(exp);
-					return NF_DROP;
+					ret = NF_DROP;
 				} else {
-					return NF_ACCEPT;
+					ret = NF_ACCEPT;
 				}
 			}
+
+			ip_conntrack_expect_put(exp);
+
+			if (ret != NF_ACCEPT)
+				return ret;
 		}
 	}
 

Modified: trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_nat_h323.c
===================================================================
--- trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_nat_h323.c	2006-01-12 06:23:57 UTC (rev 6391)
+++ trunk/patch-o-matic-ng/patchlets/h323-conntrack-nat/linux-2.6.13/net/ipv4/netfilter/ip_nat_h323.c	2006-01-12 06:32:29 UTC (rev 6392)
@@ -108,7 +108,7 @@
 	}
 
 	if (port == 0) {
-		ip_conntrack_expect_free(exp);
+		ip_conntrack_expect_put(exp);
 		return NF_DROP;
 	}
 
@@ -156,7 +156,7 @@
 	}
 
 	if (port == 0) {
-		ip_conntrack_expect_free(exp);
+		ip_conntrack_expect_put(exp);
 		return NF_DROP;
 	}
 




More information about the netfilter-cvslog mailing list