On Mon, Feb 18, 2008 at 05:39:03PM +0200, Pekka Pietikainen wrote:
> When playing with some L2 level fuzzing I started getting lots of
> "protocol 0300 is buggy, dev eth3" spew in dmesg. That interface is also
> capturing the traffic that's being sent, that's probably why the
> dev_queue_xmit_nit codepath is getting called in the first place.
> 
> Any ideas? Add a "If it came from AF_PACKET, don't print out anything" to
> that if-statement?
I'm probably just plastering over a bug in af_packet.c with this one,
but the following patch should make it shut up. The printk definately
needs a ntohs for skb2->protocol, took me a while to figure out where
the 0300 even came from :-) 

Signed-off-by: Pekka Pietikainen <[EMAIL PROTECTED]>

diff -up linux-2.6.24.i686/net/core/dev.c.orig linux-2.6.24.i686/net/core/dev.c
--- linux-2.6.24.i686/net/core/dev.c.orig       2008-02-19 15:22:12.000000000 
+0200
+++ linux-2.6.24.i686/net/core/dev.c    2008-02-19 15:29:37.000000000 +0200
@@ -1262,10 +1262,11 @@ static void dev_queue_xmit_nit(struct sk
 
                        if (skb_network_header(skb2) < skb2->data ||
                            skb2->network_header > skb2->tail) {
-                               if (net_ratelimit())
-                                       printk(KERN_CRIT "protocol %04x is "
-                                              "buggy, dev %s\n",
-                                              skb2->protocol, dev->name);
+                               if (skb2->protocol != htons(ETH_P_ALL) &&
+                                   net_ratelimit())
+                                       pr_crit("protocol %04x is buggy, dev 
%s\n",
+                                               ntohs(skb2->protocol),
+                                               dev->name);
                                skb_reset_network_header(skb2);
                        }
 


-- 
Pekka Pietikainen
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to