All of lore.kernel.org
 help / color / mirror / Atom feed
* [NETFILTER 4/4]: Fix DHCP + MASQUERADE problem
@ 2005-09-13  7:37 Patrick McHardy
  2005-09-13 20:49 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2005-09-13  7:37 UTC (permalink / raw)
  To: David S. Miller; +Cc: Netfilter Development Mailinglist, stable

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

This is the fix for the DHCP+MASQUERADE regression.

@the -stable people: please apply this patch to -stable.
To avoid confusion, only this patch (4/4) is meant for
-stable, the first three patches were not CCed.

[-- Attachment #2: 04.diff --]
[-- Type: text/x-patch, Size: 1604 bytes --]

[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>

---
commit 5048a58f5d9643ca88593cda13433006599b77d3
tree fec8093ebdf5c8f44c87492fadcedbb7ad40f6ae
parent 9af9e2ec732d00e62b458b46829bc696987d68af
author Patrick McHardy <kaber@trash.net> Tue, 13 Sep 2005 09:32:06 +0200
committer Patrick McHardy <kaber@trash.net> Tue, 13 Sep 2005 09:32:06 +0200

 net/ipv4/netfilter/ipt_MASQUERADE.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c
--- a/net/ipv4/netfilter/ipt_MASQUERADE.c
+++ b/net/ipv4/netfilter/ipt_MASQUERADE.c
@@ -90,6 +90,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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-13 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-13  7:37 [NETFILTER 4/4]: Fix DHCP + MASQUERADE problem Patrick McHardy
2005-09-13 20:49 ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.