From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: xiaosuo@gmail.com, bridge@lists.linux-foundation.org,
netdev@vger.kernel.org
Subject: Re: [PATCH] net: bridge: check the length of skb after nf_bridge_maybe_copy_header()
Date: Mon, 3 Jan 2011 10:15:33 -0800 [thread overview]
Message-ID: <20110103101533.3f98b311@nehalam> (raw)
In-Reply-To: <20110103.092214.193706896.davem@davemloft.net>
On Mon, 03 Jan 2011 09:22:14 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Changli Gao <xiaosuo@gmail.com>
> Date: Mon, 3 Jan 2011 18:44:59 +0800
>
> > On Sat, Jan 1, 2011 at 3:10 AM, David Miller <davem@davemloft.net> wrote:
> >> From: Changli Gao <xiaosuo@gmail.com>
> >> Date: Sat, 25 Dec 2010 21:41:30 +0800
> >>
> >>> Since nf_bridge_maybe_copy_header() may change the length of skb,
> >>> we should check the length of skb after it to handle the ppoe skbs.
> >>>
> >>> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> >>
> >> This is really strange.
> >>
> >> packet_length() subtracts VLAN_HLEN from the value it returns, so the
> >> correct fix seems to be to make this function handle the PPPOE case
> >> too.
> >>
> >
> > It is correct. The actual MTU of 802.1q frame is 4 bytes larger. For
> > example, the MTU of ethernet is normally 1500, however the actual MTU
> > of the 802.1Q is 1504.
>
> Yes, I understand this, but I don't see why packet_length() cannot
> simply account for PPPOE's encapsulation overhead just as it does for
> VLAN's special MTU considerations.
Because PPPOE happens afterwards and is not part the calculation.
The check should be moved until after skb has reached final form.
--
next prev parent reply other threads:[~2011-01-03 18:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-25 13:41 [PATCH] net: bridge: check the length of skb after nf_bridge_maybe_copy_header() Changli Gao
2010-12-31 19:10 ` David Miller
2011-01-03 10:44 ` Changli Gao
2011-01-03 17:22 ` David Miller
2011-01-03 18:15 ` Stephen Hemminger [this message]
2011-01-03 20:13 ` David Miller
2011-01-05 13:37 ` Changli Gao
2011-01-06 19:33 ` David Miller
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=20110103101533.3f98b311@nehalam \
--to=shemminger@linux-foundation.org \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=xiaosuo@gmail.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).