]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add fix for DHCP + MASQUERADE problem
authorChris Wright <chrisw@osdl.org>
Tue, 13 Sep 2005 16:45:52 +0000 (09:45 -0700)
committerChris Wright <chrisw@osdl.org>
Tue, 13 Sep 2005 16:45:52 +0000 (09:45 -0700)
queue/netfilter-fix-dhcp-masquerade-problem.patch [new file with mode: 0644]
queue/series

diff --git a/queue/netfilter-fix-dhcp-masquerade-problem.patch b/queue/netfilter-fix-dhcp-masquerade-problem.patch
new file mode 100644 (file)
index 0000000..05230d8
--- /dev/null
@@ -0,0 +1,40 @@
+From stable-bounces@linux.kernel.org  Tue Sep 13 00:37:52 2005
+Date: Tue, 13 Sep 2005 09:37:22 +0200
+From: Patrick McHardy <kaber@trash.net>
+To: "David S. Miller" <davem@davemloft.net>
+Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>,
+        stable@kernel.org
+Subject: [NETFILTER]: Fix DHCP + MASQUERADE problem
+
+In 2.6.13-rcX the MASQUERADE target was changed not to exclude local
+packets for better source address consistency. This breaks DHCP clients
+using UDP sockets when the DHCP requests are caught by a MASQUERADE rule
+because the MASQUERADE target drops packets when no address is configured
+on the outgoing interface. This patch makes it ignore packets with a
+source address of 0.
+
+Thanks to Rusty for this suggestion.
+
+Signed-off-by: Patrick McHardy <kaber@trash.net>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+ net/ipv4/netfilter/ipt_MASQUERADE.c |    6 ++++++
+ 1 files changed, 6 insertions(+)
+
+Index: linux-2.6.13.y/net/ipv4/netfilter/ipt_MASQUERADE.c
+===================================================================
+--- linux-2.6.13.y.orig/net/ipv4/netfilter/ipt_MASQUERADE.c
++++ linux-2.6.13.y/net/ipv4/netfilter/ipt_MASQUERADE.c
+@@ -95,6 +95,12 @@ masquerade_target(struct sk_buff **pskb,
+       IP_NF_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED
+                           || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY));
++      /* Source address is 0.0.0.0 - locally generated packet that is
++       * probably not supposed to be masqueraded.
++       */
++      if (ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip == 0)
++              return NF_ACCEPT;
++
+       mr = targinfo;
+       rt = (struct rtable *)(*pskb)->dst;
+       newsrc = inet_select_addr(out, rt->rt_gateway, RT_SCOPE_UNIVERSE);
index d59e0c94718ca9f0de3e0f46ef290f60f4b79d6d..868badb0d6824f18ed341411de9397943a4b118b 100644 (file)
@@ -2,3 +2,4 @@ forcedeth-init-link-settings-in-nv_open.patch
 hpt366-write-dword-not-byte-for-ROM-resource.patch
 sungem-enable-and-map-pci-rom-properly.patch
 sunhme-enable-and-map-pci-rom-properly.patch
+netfilter-fix-dhcp-masquerade-problem.patch