Netdev List
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Miller <davem@davemloft.net>, fw@strlen.de, netdev@vger.kernel.org
Subject: Re: [PATCH -next 0/3] net: cap size to original frag size when refragmenting
Date: Thu, 16 Apr 2015 06:42:34 +0100	[thread overview]
Message-ID: <20150416054233.GB3285@acer.localdomain> (raw)
In-Reply-To: <20150416052904.GA12648@gondor.apana.org.au>

On 16.04, Herbert Xu wrote:
> On Thu, Apr 16, 2015 at 06:24:00AM +0100, Patrick McHardy wrote:
> >
> > Netfilter may change the contents of the packet, even change its size.
> > It is *really* hard to do this while keeping the original fragments
> > intact.
> 
> Perhaps we should provide better helpers to facilitate this?
> 
> So instead of directly manipulating the content of the skb you
> would so so through helpers and the helpers can then try to do
> sensible things with the fragments.

Yeah, but its going to get pretty complicated. There can be multiple
size changes and modifications for every packet, so we would need to
keep track of the size modifications that have already occured to
map to the correct position in the frag_list. The modifications
would then have to be performed on both the reassembled skb since
they might again be matched against later on and on the frag_list,
potentially split over multiple skbs.

When enlarging the packet, I guess we would insert a new (small)
fragment to keep the geometry of the original fragments. In extreme
cases like H.323 NAT this might result in a huge amount of new very
small fragments. And it might still break the geometry when the
size difference isn't representable as a multiple of 8.

When reducing the skb size, we might have to choice but to change
the geometry of at least on fragment and would have to shift a lot
of data around.

This is very complicated, it we really want to do this, its a lot
easier to just keep note of the full original geometry and refragment
to those exact sizes while potentially adding or removing things
at the end.

My personal opinion is, why bother. The only thing that cares about
the fragment sizes is PMTUD, and that's what this patch is fixing in
a much simpler fashion.

  reply	other threads:[~2015-04-16  5:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 22:16 [PATCH -next 0/3] net: cap size to original frag size when refragmenting Florian Westphal
2015-04-10 22:16 ` [PATCH -next 1/3] ipv4: reject too-big defragmented DF-skb when forwarding Florian Westphal
2015-04-10 22:51   ` Hannes Frederic Sowa
2015-04-10 22:16 ` [PATCH -next 2/3] ipv6: don't increase size when refragmenting forwarded skbs Florian Westphal
2015-04-10 22:16 ` [PATCH -next 3/3] ipv4: don't remove df bit when refragmenting Florian Westphal
2015-04-12  8:51   ` Florian Westphal
2015-04-13 17:53 ` [PATCH -next 0/3] net: cap size to original frag size " David Miller
2015-04-13 18:40   ` Hannes Frederic Sowa
2015-04-13 18:56     ` Hannes Frederic Sowa
2015-04-13 20:16     ` David Miller
2015-04-13 20:33       ` Hannes Frederic Sowa
2015-04-16  4:56   ` Herbert Xu
2015-04-16  5:24     ` Patrick McHardy
2015-04-16  5:29       ` Herbert Xu
2015-04-16  5:42         ` Patrick McHardy [this message]
2015-04-16 12:11         ` Hannes Frederic Sowa
2015-04-16 15:43           ` David Miller
2015-04-16 16:13             ` Hannes Frederic Sowa
2015-04-16 20:47               ` Herbert Xu
2015-04-16 20:56                 ` Patrick McHardy
2015-04-16 23:16                   ` Hannes Frederic Sowa
2015-04-16 23:44                     ` Patrick McHardy
2015-04-16 20:32             ` Patrick McHardy
2015-04-16 15:32       ` David Miller
2015-04-16 20:55         ` Patrick McHardy

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=20150416054233.GB3285@acer.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --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