From: David Miller <davem@davemloft.net>
To: fan.du@windriver.com
Cc: steffen.klassert@secunet.com, netdev@vger.kernel.org
Subject: Re: [PATCH net] {pktgen, xfrm} re-caculate IPv4 checksum after transformation
Date: Sat, 30 Nov 2013 16:17:49 -0500 (EST) [thread overview]
Message-ID: <20131130.161749.1028599462373827329.davem@davemloft.net> (raw)
In-Reply-To: <1385693949-3786-1-git-send-email-fan.du@windriver.com>
From: Fan Du <fan.du@windriver.com>
Date: Fri, 29 Nov 2013 10:59:09 +0800
> @@ -2786,6 +2786,8 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
> #ifdef CONFIG_XFRM
> if (!process_ipsec(pkt_dev, skb, protocol))
> return NULL;
> + iph = ip_hdr(skb);
> + ip_send_check(iph);
> #endif
This is rediculous. You're computing the checksum _twice_ unconditionally,
even if process_ipsec() does _nothing_.
Make process_ipsec() fix the checksum, but only if it actually does
something which makes the recomputation even necessary.
Thanks.
prev parent reply other threads:[~2013-11-30 21:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-29 2:59 [PATCH net] {pktgen, xfrm} re-caculate IPv4 checksum after transformation Fan Du
2013-11-30 21:17 ` David Miller [this message]
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=20131130.161749.1028599462373827329.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=fan.du@windriver.com \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.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).