All of lore.kernel.org
 help / color / mirror / Atom feed
From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Subject: Re: [PATCH] ndisc: Ensure to reserve header space for encapsulation.
Date: Thu, 27 Dec 2012 04:08:45 +0900	[thread overview]
Message-ID: <50DB4B3D.2050800@linux-ipv6.org> (raw)
In-Reply-To: <1356540521.20133.20554.camel@edumazet-glaptop>

Eric Dumazet wrote:
> On Tue, 2012-12-25 at 23:39 +0900, YOSHIFUJI Hideaki wrote:
>> We allocate sk_buff of MAX_HEADER + LL_RESERVED_SPACE(dev) + packet
>> length + dev->needed_tailroom, but reserved LL_RESERVED_SPACE(dev)
>> only.  This means that space for encapsulation was placed at the end
>> of buffer.  This does not make sense.
>>
>> Reserve the space correctly, like this:
>>
>> head                       data                   tail       end
>> +--------------------------------------------------------------+
>> +                |           |                      |          |
>> +--------------------------------------------------------------+
>> |<--MAX_HEADER-->|<-hlen---->|<---ipv6 packet------>|<--tlen-->|
>>                    =LL_
>>                     RESERVED_
>>                     SPACE(dev)
>>
>> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
>> ---
:
> It looks like this MAX_HEADER reserve is not needed at all.
> 
> Space for encapsulation should already be in 
> int hlen = LL_RESERVED_SPACE(dev);
> 
> arp_create() for example doesnt add this MAX_HEADER 
> 
> If extra encapsulation is needed (at head or at tail), it really should
> be documented.

Current code does not make sense, at least.

Please refer to my previous posting: "[GIT PULL net-next 01/17]
ndisc: Fix size calculation for headers." around Dec/19.

My previous patch did remove MAX_HEADER from allocation.

--yoshfuji

  reply	other threads:[~2012-12-26 19:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-25 14:39 [PATCH] ndisc: Ensure to reserve header space for encapsulation YOSHIFUJI Hideaki
2012-12-26 16:48 ` Eric Dumazet
2012-12-26 19:08   ` YOSHIFUJI Hideaki [this message]
2012-12-26 19:21     ` Eric Dumazet

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=50DB4B3D.2050800@linux-ipv6.org \
    --to=yoshfuji@linux-ipv6.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.