Skip to contentSkip to conversation

2.4/2.5 ip_conntrack bugfix for LOCAL_NAT and PPTP

PATCH Applied Harald Welte 2 participants 2 messages Mar 30, 2003 – Mar 31, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4/2.5 ip_conntrack bugfix for LOCAL_NAT and PPTP

Hi Davem!

Author: Paul Mielke <[email protected]>
This patch fixes a bug introduced with the LOCAL_NAT support of linux kernels >= 2.4.19, which caused a problem with locally-terminated connections and certain NAT application helpers (esp. PPTP).

Please apply to 2.4.x and 2.5.x (applies cleanly to 2.5.66), thanks.

net/ipv4/netfilter/ip_nat_standalone.c +6 -6
@@ -109,12 +109,6 @@
 		}
 		/* Fall thru... (Only ICMPs can be IP_CT_IS_REPLY) */
 	case IP_CT_NEW:
-#ifdef CONFIG_IP_NF_NAT_LOCAL
-		/* LOCAL_IN hook doesn't have a chain and thus doesn't care
-		 * about new packets -HW */
-		if (hooknum == NF_IP_LOCAL_IN)
-			return NF_ACCEPT;
-#endif
 		info = &ct->nat.info;
 
 		WRITE_LOCK(&ip_nat_lock);
@@ -130,6 +124,12 @@
 				ret = call_expect(master_ct(ct), pskb, 
 						  hooknum, ct, info);
 			} else {
+#ifdef CONFIG_IP_NF_NAT_LOCAL
+				/* LOCAL_IN hook doesn't have a chain!  */
+				if (hooknum == NF_IP_LOCAL_IN) {
+					ret = NF_ACCEPT;
+				} else
+#endif
 				ret = ip_nat_rule_find(pskb, hooknum, in, out,
 						       ct, info);
 			}
Signature · 5 lines
- Harald Welte <[email protected]>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
#1 lore raw

From: Harald Welte <[email protected]>
Date: Sun, 30 Mar 2003 21:51:13 +0200

Author: Paul Mielke <[email protected]>
This patch fixes a bug introduced with the LOCAL_NAT support of linux kernels >= 2.4.19, which caused a problem with locally-terminated connections and certain NAT application helpers (esp. PPTP).

Applied to both 2.4.x and 2.5.x, thank you.