From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: netfilter-devel@lists.netfilter.org
Subject: [PATCH 2.4 4/18]: Apply PRE_ROUTING manips in LOCAL_OUT for locally generated icmp errors
Date: Mon, 20 Dec 2004 08:14:19 +0100 [thread overview]
Message-ID: <41C67BCB.8070700@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 143 bytes --]
Locally generated ICMP errors never hit PRE_ROUTING,
apply their manips in LOCAL_OUT. Fixes invalid
addressed ICMP errors for SNATed packets.
[-- Attachment #2: 04.diff --]
[-- Type: text/x-patch, Size: 1529 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/12/05 22:15:40+01:00 kaber@coreworks.de
# [NETFILTER]: Apply PRE_ROUTING manips in LOCAL_OUT for locally generated icmp errors
#
# Locally generated ICMP errors never hit PRE_ROUTING. Fixes invalid
# addressed ICMP errors for SNATed packets.
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/ipv4/netfilter/ip_nat_core.c
# 2004/12/05 22:15:39+01:00 kaber@coreworks.de +8 -0
# [NETFILTER]: Apply PRE_ROUTING manips in LOCAL_OUT for locally generated icmp errors
#
# Locally generated ICMP errors never hit PRE_ROUTING. Fixes invalid
# addressed ICMP errors for SNATed packets.
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c
--- a/net/ipv4/netfilter/ip_nat_core.c 2004-12-20 06:59:28 +01:00
+++ b/net/ipv4/netfilter/ip_nat_core.c 2004-12-20 06:59:28 +01:00
@@ -918,6 +918,14 @@
/* Mapping the inner packet is just like a normal packet, except
* it was never src/dst reversed, so where we would normally
* apply a dst manip, we apply a src, and vice versa. */
+
+ /* Only true for forwarded packets, locally generated packets
+ * never hit PRE_ROUTING, we need to apply their PRE_ROUTING
+ * manips in LOCAL_OUT. */
+ if (hooknum == NF_IP_LOCAL_OUT &&
+ info->manips[i].hooknum == NF_IP_PRE_ROUTING)
+ hooknum = info->manips[i].hooknum;
+
if (info->manips[i].hooknum != hooknum)
continue;
reply other threads:[~2004-12-20 7:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41C67BCB.8070700@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.