All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: [PATCH 2.6]: Prevent NAT from seeing fragments
Date: Fri, 18 Feb 2005 01:23:44 +0100	[thread overview]
Message-ID: <42153590.8010704@trash.net> (raw)

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

This patch fixes another fragment handling problem, on loopback NAT might
get to see fragments because conntrack skips defragmentation for already
seen traffic. It just meant as a temporary solution for 2.6.11, in 2.6.12
we would prefer to skip refragmentation for loopback if it doesn't cause
problems.

Regards
Patrick


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1755 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/02/18 01:11:06+01:00 kaber@coreworks.de 
#   [NETFILTER]: Prevent NAT from seeing fragments
#   
#   The path for loopback is:
#   LOCAL_OUT: conntrack defrags
#   POST_ROUTING: conntrack refrags
#   PRE_ROUTING: skip conntrack defrag because skb->nfct != NULL
#   PRE_ROUTING: NAT gets hit by fragments
#   
#   Always defrag on loopback if NAT is compiled in.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Acked-by: Rusty Russel <rusty@rustcorp.com.au>
# 
# net/ipv4/netfilter/ip_conntrack_standalone.c
#   2005/02/18 01:10:55+01:00 kaber@coreworks.de +2 -0
#   [NETFILTER]: Prevent NAT from seeing fragments
#   
#   The path for loopback is:
#   LOCAL_OUT: conntrack defrags
#   POST_ROUTING: conntrack refrags
#   PRE_ROUTING: skip conntrack defrag because skb->nfct != NULL
#   PRE_ROUTING: NAT gets hit by fragments
#   
#   Always defrag on loopback if NAT is compiled in.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   Acked-by: Rusty Russel <rusty@rustcorp.com.au>
# 
diff -Nru a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c	2005-02-18 01:15:36 +01:00
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c	2005-02-18 01:15:36 +01:00
@@ -384,10 +384,12 @@
 				        const struct net_device *out,
 				        int (*okfn)(struct sk_buff *))
 {
+#if !defined(CONFIG_IP_NF_NAT) && !defined(CONFIG_IP_NF_NAT_MODULE)
 	/* Previously seen (loopback)?  Ignore.  Do this before
            fragment check. */
 	if ((*pskb)->nfct)
 		return NF_ACCEPT;
+#endif
 
 	/* Gather fragments. */
 	if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) {

             reply	other threads:[~2005-02-18  0:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-18  0:23 Patrick McHardy [this message]
2005-02-24  4:10 ` [PATCH 2.6]: Prevent NAT from seeing fragments David S. Miller

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=42153590.8010704@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.