mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Simon Barber" <simon@instant802.com>
To: "Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	<netdev@oss.sgi.com>
Cc: "Bart De Schuymer" <bdschuym@pandora.be>
Subject: [PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb
Date: Wed, 25 Feb 2004 14:47:41 -0800	[thread overview]
Message-ID: <AC8C1F46CD753F4AAC8F890E35A9EB461C670B@webmail.instant802.com> (raw)

Currently skb->protocol is read before the bridge is called, even though
it's not used until after. Hence if an ebtables module changes the
protocol of a frame the wrong protocol is interpreted.

Simon Barber

--- linux-2.4.26-pre1.orig/net/core/dev.c	2004-02-25
04:16:33.000000000 -0800
+++ linux-2.4.26-pre1/net/core/dev.c	2004-02-25 06:42:05.000000000
-0800
@@ -1462,7 +1462,7 @@
 {
 	struct packet_type *ptype, *pt_prev;
 	int ret = NET_RX_DROP;
-	unsigned short type = skb->protocol;
+	unsigned short type;
 
 	if (skb->stamp.tv_sec == 0)
 		do_gettimeofday(&skb->stamp);
@@ -1507,6 +1507,7 @@
 	}
 #endif
 
+	type = skb->protocol;
 	for (ptype=ptype_base[ntohs(type)&15];ptype;ptype=ptype->next) {
 		if (ptype->type == type &&
 		    (!ptype->dev || ptype->dev == skb->dev)) {

             reply	other threads:[~2004-02-25 22:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-25 22:47 Simon Barber [this message]
2004-02-26 19:57 ` David S. 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=AC8C1F46CD753F4AAC8F890E35A9EB461C670B@webmail.instant802.com \
    --to=simon@instant802.com \
    --cc=bdschuym@pandora.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.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

all inboxes | Powered by JetHome®