netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lennert Buytenhek <buytenh@wantstofly.org>
To: Bart De Schuymer <bdschuym@pandora.be>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@oss.sgi.com, snort2004@mail.ru
Subject: Re: [PATCH][BRIDGE-NF] Fix wrong use of skb->protocol
Date: Fri, 31 Dec 2004 09:33:52 +0100	[thread overview]
Message-ID: <20041231083352.GA25031@xi.wantstofly.org> (raw)
In-Reply-To: <1104448248.15601.55.camel@localhost.localdomain>

On Fri, Dec 31, 2004 at 12:10:48AM +0100, Bart De Schuymer wrote:

> > A while ago there were a number of problems with bridging CIPE ethernet
> > devices, which turned out to be the bridge code not initialising
> > skb->protocol for locally originated STP frames.
> > 
> > At the time I was told that initialising skb->protocol for locally
> > originated packets is required, so that is how I fixed it then.
> 
> Hi Lennert,

Hello,


> skb->protocol is not set for locally generated packets when the packet
> is still in the IP stack. I don't know what happens with it after the IP
> stack is finished with the packet.
> The comment in skbuff.h says "packet protocol from driver", from which I
> tend to conclude that skb->protocol is only set by drivers when a packet
> enters the box.
> Too bad stuff like this isn't clearly spelled out,

This is what I thought back then too.  Indeed, it's rather misleading.


> the FIXME for the dst field has been sitting there for probably more
> than a year too.

Yes :(

Just one more thing: AFAIK it is possible to inject a raw IPv4 packet
with an invalid IPv4 header.  So maybe the better 'fix' would be to have
different hooks for PF_INET and PF_INET6, and distinguish v4/v6 packets
that way instead of peeking into the header.  (The hook you're talking
about is a PF_INET* and not a PF_BRIDGE hook, right?)

Then again, that would add yet another function onto the already rather
deep call chains that we have in there.

Too bad I don't see any cleaner way of integrating the whole bridging
thing into the stack.  I wonder if any of the *BSDs found a cleaner way
of doing this.


--L

  parent reply	other threads:[~2004-12-31  8:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-30 18:55 [PATCH][BRIDGE-NF] Fix wrong use of skb->protocol Bart De Schuymer
2004-12-30 22:24 ` Lennert Buytenhek
2004-12-30 23:10   ` Bart De Schuymer
2004-12-31  0:33     ` Patrick McHardy
2004-12-31  8:33     ` Lennert Buytenhek [this message]
2004-12-31 10:51       ` Bart De Schuymer

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=20041231083352.GA25031@xi.wantstofly.org \
    --to=buytenh@wantstofly.org \
    --cc=bdschuym@pandora.be \
    --cc=davem@davemloft.net \
    --cc=netdev@oss.sgi.com \
    --cc=snort2004@mail.ru \
    /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).