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-devel@lists.netfilter.org
Subject: Re: Fw: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2)
Date: Fri, 28 Jan 2005 02:56:08 +0100	[thread overview]
Message-ID: <41F99BB8.4070409@trash.net> (raw)
In-Reply-To: <41F992E3.20005@trash.net>

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

Patrick McHardy wrote:

> IP (tos 0xd0, ttl  64, id 40755, offset 0, flags [none], length: 88) 
> 172.16.1.123 > 172.16.1.123: icmp 68: type-#142 for IP (tos 0x10, ttl 
> 180, id 13605, offset 0, flags [DF], length: 60, bad cksum e8b3 
> (->73d8)!) 172.16.1.123 > 172.16.195.55:  ip-proto-225 40
>
> This patch fixes it.

This patch on top fixes corrupt checksums of ICMP errors. The
function returns before recalculating the checksum in some cases.

>
> Signed-off-by: Patrick McHardy <kaber@trash.net>



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

===== net/ipv4/netfilter/ip_nat_core.c 1.67 vs edited =====
--- 1.67/net/ipv4/netfilter/ip_nat_core.c	2005-01-18 21:27:23 +01:00
+++ edited/net/ipv4/netfilter/ip_nat_core.c	2005-01-28 02:48:04 +01:00
@@ -450,6 +450,13 @@
 		       !manip))
 		return 0;
 
+	/* Reloading "inside" here since manip_pkt inner. */
+	inside = (void *)(*pskb)->data + (*pskb)->nh.iph->ihl*4;
+	inside->icmp.checksum = 0;
+	inside->icmp.checksum = csum_fold(skb_checksum(*pskb, hdrlen,
+						       (*pskb)->len - hdrlen,
+						       0));
+
 	/* Change outer to look the reply to an incoming packet
 	 * (proto 0 means don't invert per-proto part). */
 
@@ -468,13 +475,6 @@
 			return 0;
 	}
 
-	/* Reloading "inside" here since manip_pkt inner. */
-	inside = (void *)(*pskb)->data + (*pskb)->nh.iph->ihl*4;
-
-	inside->icmp.checksum = 0;
-	inside->icmp.checksum = csum_fold(skb_checksum(*pskb, hdrlen,
-						       (*pskb)->len - hdrlen,
-						       0));
 	return 1;
 }
 

  reply	other threads:[~2005-01-28  1:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-27 23:41 Fw: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) David S. Miller
2005-01-28  1:18 ` Patrick McHardy
2005-01-28  1:56   ` Patrick McHardy [this message]
2005-01-31  6:49     ` 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=41F99BB8.4070409@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.