From: Herbert Xu <herbert@gondor.apana.org.au>
To: "David S. Miller" <davem@redhat.com>
Cc: James Morris <jmorris@redhat.com>, netdev@oss.sgi.com
Subject: Re: pskb change in dst->output
Date: Sat, 10 Jul 2004 06:42:28 +1000 [thread overview]
Message-ID: <20040709204228.GA3015@gondor.apana.org.au> (raw)
In-Reply-To: <20040709123608.1f9f9265.davem@redhat.com>
On Fri, Jul 09, 2004 at 12:36:08PM -0700, David S. Miller wrote:
>
> > > If there are no objections, I'd like to create a version of
> > > skb_checksum_help() that doesn't copy the packet, and call
> > > that version from ah_output()/esp_output()/ipcomp_output().
> >
> > This will break when cloned packets are passed to these functions.
>
> James is right Herbert. TCP will send clones down into these routines
> all the time.
The first TCP transmission will always be a clone of a packet off
its output queue. However, the TCP code is written such that you
can modify any part of the skb except the TCP payload. This
includes the TCP header which is where the TCP checksum is.
If this weren't the case then you'd have to copy the packet much earlier.
This assumption is already made by tcp_transmit_skb(), ip_queue_xmit()
and all the functions called by dst_output().
When TCP retransmits the packet, it will do a pskb_copy() on it so
it's no longer a clone.
So unless I've missed another case where someone will pass a clone
down, it is safe to change the checksum on the TCP clones.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2004-07-09 20:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-07 13:06 pskb change in dst->output Herbert Xu
2004-07-07 14:58 ` James Morris
2004-07-07 21:28 ` Herbert Xu
2004-07-07 22:01 ` David S. Miller
2004-07-07 23:12 ` Herbert Xu
2004-07-07 23:33 ` James Morris
2004-07-08 0:04 ` Herbert Xu
2004-07-08 0:17 ` David S. Miller
2004-07-08 0:35 ` Herbert Xu
2004-07-08 1:05 ` James Morris
2004-07-08 1:11 ` Herbert Xu
2004-07-08 1:19 ` James Morris
2004-07-08 3:34 ` James Morris
2004-07-08 4:02 ` Herbert Xu
2004-07-09 8:14 ` Herbert Xu
2004-07-09 14:02 ` James Morris
2004-07-09 19:36 ` David S. Miller
2004-07-09 20:42 ` Herbert Xu [this message]
2004-07-09 21:07 ` Herbert Xu
2004-07-09 21:21 ` David S. Miller
2004-07-09 21:43 ` Herbert Xu
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=20040709204228.GA3015@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@redhat.com \
--cc=jmorris@redhat.com \
--cc=netdev@oss.sgi.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).