From: Florian Westphal <fw@strlen.de>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Praveen Chaudhary <praveen5582@gmail.com>,
fw@strlen.de, pablo@netfilter.org, davem@davemloft.net,
kadlec@netfilter.org, netfilter-devel@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Zhenggen Xu <zxu@linkedin.com>,
Andy Stracner <astracner@linkedin.com>
Subject: Re: [PATCH v3] [net]: Fix skb->csum update in inet_proto_csum_replace16().
Date: Wed, 22 Jan 2020 12:43:33 +0100 [thread overview]
Message-ID: <20200122114333.GQ795@breakpoint.cc> (raw)
In-Reply-To: <16d56ee6-53bc-1124-3700-bc0a78f927d6@iogearbox.net>
Daniel Borkmann <daniel@iogearbox.net> wrote:
> > @@ -449,9 +464,6 @@ void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
> > if (skb->ip_summed != CHECKSUM_PARTIAL) {
> > *sum = csum_fold(csum_partial(diff, sizeof(diff),
> > ~csum_unfold(*sum)));
> > - if (skb->ip_summed == CHECKSUM_COMPLETE && pseudohdr)
> > - skb->csum = ~csum_partial(diff, sizeof(diff),
> > - ~skb->csum);
>
> What is the technical rationale in removing this here but not in any of the
> other inet_proto_csum_replace*() functions? You changelog has zero analysis
> on why here but not elsewhere this change would be needed?
Right, I think it could be dropped everywhere BUT there is a major caveat:
At least for the nf_nat case ipv4 header manipulation (which uses the other
helpers froum utils.c) will eventually also update iph->checksum field
to account for the changed ip addresses.
And that update doesn't touch skb->csum.
So in a way the update of skb->csum in the other helpers indirectly account
for later ip header checksum update.
At least that was my conclusion when reviewing the earlier incarnation
of the patch.
next prev parent reply other threads:[~2020-01-22 11:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 22:52 [PATCH v3] [net]: Fix skb->csum update in inet_proto_csum_replace16() Praveen Chaudhary
2019-11-06 22:52 ` Praveen Chaudhary
2020-01-22 10:17 ` Daniel Borkmann
2020-01-22 11:43 ` Florian Westphal [this message]
2020-01-22 16:22 ` Daniel Borkmann
2020-01-23 8:21 ` Florian Westphal
2020-01-23 14:20 ` Daniel Borkmann
2020-01-23 14:29 ` Florian Westphal
2020-01-23 20:33 ` [PATCH v4] " Praveen Chaudhary
2020-01-23 20:33 ` Praveen Chaudhary
2020-01-24 19:04 ` Pablo Neira Ayuso
2020-01-23 20:50 ` [PATCH v3] " Praveen Chaudhary
2020-01-22 5:51 ` Praveen Chaudhary
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=20200122114333.GQ795@breakpoint.cc \
--to=fw@strlen.de \
--cc=astracner@linkedin.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kadlec@netfilter.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=praveen5582@gmail.com \
--cc=zxu@linkedin.com \
/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).