netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb
@ 2004-02-25 22:47 Simon Barber
  2004-02-26 19:57 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Barber @ 2004-02-25 22:47 UTC (permalink / raw)
  To: Kernel Mailing List, netdev; +Cc: Bart De Schuymer

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)) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb
  2004-02-25 22:47 [PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb Simon Barber
@ 2004-02-26 19:57 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-02-26 19:57 UTC (permalink / raw)
  To: Simon Barber; +Cc: linux-kernel, netdev, bdschuym

On Wed, 25 Feb 2004 14:47:41 -0800
"Simon Barber" <simon@instant802.com> wrote:

> 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.

Applied, even though ebtables is not in 2.4.x yet the change is valid.
I've applied your 2.6.x variant too of course.

Thanks Simon.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-26 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-25 22:47 [PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb Simon Barber
2004-02-26 19:57 ` David S. Miller

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).