2002-07-15 14:07:46

by henrique

[permalink] [raw]
Subject: [GENERIC HDLC LAYER] Messages of a hdlc device

Hello Halasa !!!

I'm using the generic hdlc layer with PPP protocol against a Lucent MAX6000.
Everything works OK but there a kernel message bothering me:

protocol 0008 is buggy, dev hdlc0

I get this message nearly once per minute.

Do anyone know what is this message about ?
Must I worry about that ?

thanks in advance
---
Henrique Gobbi
Software Engineer
+55 11 50333339
Cyclades Corporation


2002-07-16 12:07:16

by henrique

[permalink] [raw]
Subject: Re: [GENERIC HDLC LAYER] Messages of a hdlc device

Hello !!!

Are Halasa still maintaining the GENERIC HDLC LAYER ?

If not, how is the maintainer ?

regards
henrique

On Monday 15 July 2002 11:11 am, henrique wrote:
> Hello Halasa !!!
>
> I'm using the generic hdlc layer with PPP protocol against a Lucent
> MAX6000. Everything works OK but there a kernel message bothering me:
>
> protocol 0008 is buggy, dev hdlc0
>
> I get this message nearly once per minute.
>
> Do anyone know what is this message about ?
> Must I worry about that ?
>
> thanks in advance
> ---
> Henrique Gobbi
> Software Engineer
> +55 11 50333339
> Cyclades Corporation

--

2002-07-16 13:41:02

by Krzysztof Halasa

[permalink] [raw]
Subject: Re: [GENERIC HDLC LAYER] Messages of a hdlc device

henrique <[email protected]> writes:

> I'm using the generic hdlc layer with PPP protocol against a Lucent MAX6000.
> Everything works OK but there a kernel message bothering me:
>
> protocol 0008 is buggy, dev hdlc0
>
> I get this message nearly once per minute.
>
> Do anyone know what is this message about ?

Not sure what exactly causes it. I was getting it while running tcpdump
on PPP device.

> Must I worry about that ?

No.
--
Krzysztof Halasa
Network Administrator

2002-07-16 13:51:19

by Krzysztof Halasa

[permalink] [raw]
Subject: Re: [GENERIC HDLC LAYER] Messages of a hdlc device

henrique <[email protected]> writes:

> Are Halasa still maintaining the GENERIC HDLC LAYER ?

Well... I think I, Krzysztof Halasa, still do that.

Not that I have much time for such things - at least for now I'm limited
to patching things and possibly working on 2.5 version.
--
Krzysztof Halasa
Network Administrator

2002-07-16 14:00:32

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [GENERIC HDLC LAYER] Messages of a hdlc device

Em Tue, Jul 16, 2002 at 03:10:33PM +0200, Krzysztof Halasa escreveu:
> henrique <[email protected]> writes:
>
> > I'm using the generic hdlc layer with PPP protocol against a Lucent MAX6000.
> > Everything works OK but there a kernel message bothering me:
> >
> > protocol 0008 is buggy, dev hdlc0
> >
> > I get this message nearly once per minute.
> >
> > Do anyone know what is this message about ?

> Not sure what exactly causes it. I was getting it while running tcpdump
> on PPP device.

This is becoming a FAQ... see net/core/dev.c, line 907 on 2.5:

/* skb->nh should be correctly
set by sender, so that the second statement is
just protection against buggy protocols.
*/
skb2->mac.raw = skb2->data;

if (skb2->nh.raw < skb2->data || skb2->nh.raw > skb2->tail) {
if (net_ratelimit())
printk(KERN_DEBUG "protocol %04x is buggy, dev %s\n",
skb2->protocol, dev->name);
skb2->nh.raw = skb2->data;
}

- Arnaldo

2002-07-16 15:45:36

by Bob Dunlop

[permalink] [raw]
Subject: Re: [GENERIC HDLC LAYER] Messages of a hdlc device

Hi,

On Tue, Jul 16, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jul 16, 2002 at 03:10:33PM +0200, Krzysztof Halasa escreveu:
> > henrique <[email protected]> writes:
> >
> > > I'm using the generic hdlc layer with PPP protocol against a Lucent MAX6000.
> > > Everything works OK but there a kernel message bothering me:
> > >
> > > protocol 0008 is buggy, dev hdlc0
> > >
> > > I get this message nearly once per minute.
> > >
> > > Do anyone know what is this message about ?
>
> > Not sure what exactly causes it. I was getting it while running tcpdump
> > on PPP device.
>
> This is becoming a FAQ... see net/core/dev.c, line 907 on 2.5:
>
> /* skb->nh should be correctly
> set by sender, so that the second statement is
> just protection against buggy protocols.
> */
> skb2->mac.raw = skb2->data;
>
> if (skb2->nh.raw < skb2->data || skb2->nh.raw > skb2->tail) {
> if (net_ratelimit())
> printk(KERN_DEBUG "protocol %04x is buggy, dev %s\n",
> skb2->protocol, dev->name);
> skb2->nh.raw = skb2->data;
> }

Not exactly a FAQ answer though. How about:

The error would appear to be benign. Something in the protocol stack is
not setting one of the header fields correctly and this code has corrected
the fault.

This error is only seen when running network monitoring software such as
tcpdump as that is the only time the particular code path that detects
the error is followed.


Also shouldn't that be:
> printk(KERN_DEBUG "protocol %04x is buggy, dev %s\n",
> htons(skb2->protocol), dev->name);
--
Bob Dunlop

2002-07-16 16:53:28

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [GENERIC HDLC LAYER] Messages of a hdlc device

Em Tue, Jul 16, 2002 at 04:48:17PM +0100, Bob Dunlop escreveu:
> > This is becoming a FAQ... see net/core/dev.c, line 907 on 2.5:
> >
> > /* skb->nh should be correctly
> > set by sender, so that the second statement is
> > just protection against buggy protocols.
> > */

<SNIP>

> Not exactly a FAQ answer though:

Agreed, but I talked with Henrique privately (in portuguese) and give a
long explanation with examples of how to fix that.

- Arnaldo

2002-07-16 18:33:37

by Krzysztof Halasa

[permalink] [raw]
Subject: Re: [GENERIC HDLC LAYER] Messages of a hdlc device

Arnaldo Carvalho de Melo <[email protected]> writes:

> This is becoming a FAQ... see net/core/dev.c, line 907 on 2.5:
>
> /* skb->nh should be correctly
> set by sender, so that the second statement is
> just protection against buggy protocols.
> */
> skb2->mac.raw = skb2->data;
>
> if (skb2->nh.raw < skb2->data || skb2->nh.raw > skb2->tail) {
> if (net_ratelimit())
> printk(KERN_DEBUG "protocol %04x is buggy, dev %s\n",
> skb2->protocol, dev->name);
> skb2->nh.raw = skb2->data;
> }

Sure I know thats it, but I remember checking the code which resulted
in nothing. Don't remember details, so I'll look at it again.
--
Krzysztof Halasa
Network Administrator

2002-08-30 14:12:10

by pavel

[permalink] [raw]
Subject: Re: [GENERIC HDLC LAYER] Messages of a hdlc device

> I'm using the generic hdlc layer with PPP protocol
against a Lucent MAX6000.
> Everything works OK but there a kernel message bothering
me:
> protocol 0008 is buggy, dev hdlc0
>
> I get this message nearly once per minute.
>
> Do anyone know what is this message about ?

I've seen that problem since 2.2.x kernels.
I think there is an error while building cisco/ppp
keepalive packet (hdlc.c & syncppp.c).
Lines skb->nh.raw = skb->data;
will solve it.
Following patch is for 2.2.x kernel.
If you want to patch 2.4.x, simply add
skb->nh.raw = skb->data;
at cisco_keepalive_send (hdlc.c)
at sppp_cisco_send (syncppp.c)
and at sppp_cp_send (syncppp.c)

Here is a patch(for hdlc.c & syncppp.c from 2.2.x):
==========================
diff -urN kernel-source-2.2.17.orig/drivers/net/hdlc.c
kernel-source-2.2.17.hdlc_patch/drivers/net/hdlc.c
--- kernel-source-2.2.17.orig/drivers/net/hdlc.c Sat Jun 24
15:25:37 2000
+++ kernel-source-2.2.17.hdlc_patch/drivers/net/hdlc.c Fri
Mar 22 19:51:41 2002
@@ -19,6 +19,13 @@
*
* Use sethdlc utility to set line parameters, protocol
and PVCs
*/
+ /*
+ Patched by Pavel Selivanov. 08 Aug. 2001
+ If we are using dev_queue_xmit, and we have a
listeners,
+ we should set skb->nh.raw. If no, we'll get a lot of
warnings in
+ /var/log/debug
+ Look at core/net/dev.c dev_queue_xmit_nit
+*/

#include <linux/config.h>
#include <linux/module.h>
@@ -99,6 +106,7 @@
skb_put(skb, sizeof(cisco_packet));
skb->priority=TC_PRIO_CONTROL;
skb->dev = hdlc_to_dev(hdlc);
+ skb->nh.raw = skb->data;

dev_queue_xmit(skb);
}
@@ -369,7 +377,8 @@
skb_put(skb, i);
skb->priority=TC_PRIO_CONTROL;
skb->dev = hdlc_to_dev(hdlc);
-
+ skb->nh.raw = skb->data;
+
dev_queue_xmit(skb);
}

@@ -805,6 +814,7 @@
{
pvc_device *pvc=dev_to_pvc(dev);

+ skb->nh.raw = skb->data;
if (pvc->state & PVC_STATE_ACTIVE) {
skb->dev = hdlc_to_dev(pvc->master);
pvc->stats.tx_bytes+=skb->len;
diff -urN kernel-source-2.2.17.orig/drivers/net/syncppp.c
kernel-source-2.2.17.hdlc_patch/drivers/net/syncppp.c
--- kernel-source-2.2.17.orig/drivers/net/syncppp.c Thu Jun
8 04:26:43 2000
+++
kernel-source-2.2.17.hdlc_patch/drivers/net/syncppp.c Fri
Mar 22 19:51:41 2002
@@ -16,7 +16,14 @@
*
* Port for Linux-2.1 by Jan "Yenya" Kasprzak
<[email protected]>
*/
-
+ /*
+ Patched by Pavel Selivanov. 08 Aug. 2001
+ If we are using dev_queue_xmit, and we have a listeners,
+ we should set skb->nh.raw. If no, we'll get a lot of
warnings in
+ /var/log/debug
+ Look at core/net/dev.c dev_queue_xmit_nit
+*/
+
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP
modes.
@@ -779,6 +786,8 @@
/* Control is high priority so it doesnt get queued
behind data */
skb->priority=TC_PRIO_CONTROL;
skb->dev = dev;
+ skb->nh.raw = skb->data;
+
dev_queue_xmit(skb);
}

@@ -821,6 +830,8 @@
sp->obytes += skb->len;
skb->priority=TC_PRIO_CONTROL;
skb->dev = dev;
+ skb->nh.raw = skb->data;
+
dev_queue_xmit(skb);
}
======================

Regards
Pavel
mail: pavel[AT]parabel.inc.ru