From: Patrick McHardy <kaber@trash.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: BUG: warning at net/core/dev.c:1171/skb_checksum_help() 2.6.18-rc3
Date: Thu, 03 Aug 2006 11:32:32 +0200 [thread overview]
Message-ID: <44D1C2B0.5050004@trash.net> (raw)
In-Reply-To: <20060802004929.GA12404@gondor.apana.org.au>
Herbert Xu wrote:
> On Mon, Jul 31, 2006 at 09:30:50PM +1000, herbert wrote:
>
>>>diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c
>>>index 1741d55..731efbb 100644
>>>--- a/net/ipv4/netfilter/ip_nat_core.c
>>>+++ b/net/ipv4/netfilter/ip_nat_core.c
>>>@@ -443,7 +443,9 @@ int ip_nat_icmp_reply_translation(struct
>>>
>>> /* We're actually going to mangle it beyond trivial checksum
>>> adjustment, so make sure the current checksum is correct. */
>>>- if ((*pskb)->ip_summed != CHECKSUM_UNNECESSARY) {
>>>+
>>>+ if ((*pskb)->ip_summed != CHECKSUM_UNNECESSARY &&
>>>+ (*pskb)->ip_summed != CHECKSUM_PARTIAL) {
>>> hdrlen = (*pskb)->nh.iph->ihl * 4;
>>> if ((u16)csum_fold(skb_checksum(*pskb, hdrlen,
>>> (*pskb)->len - hdrlen, 0)))
>
>
> Actually, we could drop this chunk of code altogether.
>
> The reason is that if the packet comes in with the correct checksum,
> it'll go out of NAT with the correct checksum. If it came in with
> the wrong checksum, it'll go out with the wrong checksum.
>
> We let TCP packets with incorrect checksums pass through NAT, so why
> not do the same here?
>
> After all, we're here to do NAT, not verify checksums. We charge extra
> for that :)
The checksum is verified here because a full checksum update is done
later in that function and we don't want to accidentally fix up
broken checksums.
next prev parent reply other threads:[~2006-08-03 9:32 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-31 4:16 BUG: warning at net/core/dev.c:1171/skb_checksum_help() 2.6.18-rc3 David Coulson
2006-07-31 4:24 ` Patrick McHardy
2006-07-31 4:59 ` David Miller
2006-07-31 5:07 ` Patrick McHardy
2006-07-31 10:39 ` Patrick McHardy
2006-07-31 11:30 ` Herbert Xu
2006-07-31 18:36 ` Patrick McHardy
2006-07-31 21:15 ` David Miller
2006-07-31 21:36 ` Patrick McHardy
2006-07-31 21:54 ` David Miller
2006-08-01 7:00 ` David Miller
2006-08-01 7:04 ` Herbert Xu
2006-08-01 7:22 ` Patrick McHardy
2006-08-01 15:34 ` Phil Oester
2006-08-01 22:04 ` Herbert Xu
2006-08-01 7:19 ` Patrick McHardy
2006-08-01 7:23 ` Herbert Xu
2006-08-01 7:36 ` David Miller
2006-08-01 7:45 ` Herbert Xu
2006-08-01 12:00 ` Jamal Hadi Salim
2006-08-01 12:34 ` Herbert Xu
2006-08-01 12:55 ` Jamal Hadi Salim
2006-08-01 7:38 ` Patrick McHardy
2006-08-01 11:51 ` Herbert Xu
2006-08-03 9:21 ` Patrick McHardy
2006-08-03 9:30 ` Herbert Xu
2006-08-03 9:34 ` Patrick McHardy
2006-08-01 12:29 ` Herbert Xu
2006-08-03 9:29 ` Patrick McHardy
2006-08-03 9:33 ` Herbert Xu
2006-08-03 9:40 ` Patrick McHardy
2006-08-03 9:57 ` Herbert Xu
2006-08-05 7:13 ` Patrick McHardy
2006-08-05 7:59 ` Herbert Xu
2006-08-01 22:03 ` Herbert Xu
2006-08-03 9:30 ` Patrick McHardy
2006-08-02 0:49 ` Herbert Xu
2006-08-03 9:32 ` Patrick McHardy [this message]
2006-08-03 9:36 ` Herbert Xu
2006-08-03 9:43 ` Patrick McHardy
2006-07-31 4:34 ` Andrew Morton
2006-07-31 4:42 ` David Coulson
2006-07-31 4:58 ` David 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=44D1C2B0.5050004@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).