All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart De Schuymer <bdschuym@pandora.be>
To: Lennert Buytenhek <buytenh@wantstofly.org>
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 00:10:48 +0100	[thread overview]
Message-ID: <1104448248.15601.55.camel@localhost.localdomain> (raw)
In-Reply-To: <20041230222415.GB19587@xi.wantstofly.org>

Op do, 30-12-2004 te 23:24 +0100, schreef Lennert Buytenhek:
> On Thu, Dec 30, 2004 at 07:55:14PM +0100, Bart De Schuymer wrote:
> 
> > ip_sabotage_out() needs to distinguish IPv4 and IPv6 traffic. It
> > currently does that by looking at skb->protocol. However, for locally
> > originated packets, skb->protocol is not initialized.
> > The patch below instead looks at the version number of the packet's
> > data, which should be 4 or 6.
> 
> 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,

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, the
FIXME for the dst field has been sitting there for probably more than a
year too. Anyway, it wouldn't hurt if the skb->protocol field always
held the right value.

cheers,
Bart

  reply	other threads:[~2004-12-30 23:10 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 [this message]
2004-12-31  0:33     ` Patrick McHardy
2004-12-31  8:33     ` Lennert Buytenhek
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=1104448248.15601.55.camel@localhost.localdomain \
    --to=bdschuym@pandora.be \
    --cc=buytenh@wantstofly.org \
    --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 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.