From: David Miller <davem@davemloft.net>
To: xiaosuo@gmail.com
Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] ethernet: call __skb_pull() in eth_type_trans()
Date: Mon, 03 May 2010 00:59:45 -0700 (PDT) [thread overview]
Message-ID: <20100503.005945.123415755.davem@davemloft.net> (raw)
In-Reply-To: <1272840617-17084-1-git-send-email-xiaosuo@gmail.com>
From: Changli Gao <xiaosuo@gmail.com>
Date: Mon, 3 May 2010 06:50:17 +0800
> call __skb_pull() in eth_type_trans().
>
> Since the callers of eth_type_trans() always feed it long enough packets,
> we can use __skb_pull() to save some cycles.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Although they should, assuming that some runts won't show up here and
never check for that condition at all is dangerous.
At least we should have a WARN_ON() check for skb->len < ETH_ZLEN here
or similar.
So many other things get layered into ethernet, which means adding
this length assumption without any checks is bound to lead to
unpleasant surprises for somebody.
prev parent reply other threads:[~2010-05-03 7:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-02 22:50 [PATCH] ethernet: call __skb_pull() in eth_type_trans() Changli Gao
2010-05-03 7:59 ` 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=20100503.005945.123415755.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--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