[PATCH 2.4.26-pre1] Allow ebtables module to change protocol in netif_receive_skb

From: Simon Barber
Date: Wed Feb 25 2004 - 17:57:59 EST


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)) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/