All of lore.kernel.org
 help / color / mirror / Atom feed
* Multilink and ppp_input_error().
@ 2004-11-09 17:12 Matthew N. Dodd
  2004-11-09 23:01 ` Paul Mackerras
  0 siblings, 1 reply; 2+ messages in thread
From: Matthew N. Dodd @ 2004-11-09 17:12 UTC (permalink / raw)
  To: linux-ppp

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

Has anyone else noticed that drivers/net/ppp_generic.c:ppp_input_error()
is effectively a NOP?  pppd/main.c:get_input() treats a zero length
packet as a hangup indication but if you trace out the call to
ppp_do_recv() in ppp_input_error() the zero length frame is never sent
to the file descriptor.  Further, calling an input function for the PPP
device isn't useful as the intent is to deliver the error to a specific
PPP channel.

I'm using the attached patch.

Comments?

--
Matthew N. Dodd <mdodd@patton.com>
Software Engineer, Patton Electronics
7622 Rickenbacker Dr., Gaithersburg,  MD 20879
(301) 975-1000x184

[-- Attachment #2: ppp.patch --]
[-- Type: application/octet-stream, Size: 1362 bytes --]

Index: ppp_generic.c
===================================================================
RCS file: /home/cvs/linux/drivers/net/ppp_generic.c,v
retrieving revision 1.23.2.6
diff -u -u -1 -5 -r1.23.2.6 ppp_generic.c
--- ppp_generic.c	13 Aug 2003 17:19:19 -0000	1.23.2.6
+++ ppp_generic.c	9 Nov 2004 17:08:49 -0000
@@ -1361,31 +1361,38 @@
 void
 ppp_input_error(struct ppp_channel *chan, int code)
 {
 	struct channel *pch = chan->ppp;
 	struct sk_buff *skb;
 
 	if (pch == 0)
 		return;
 
 	read_lock_bh(&pch->upl);
 	if (pch->ppp != 0) {
 		skb = alloc_skb(0, GFP_ATOMIC);
 		if (skb != 0) {
 			skb->len = 0;		/* probably unnecessary */
 			skb->cb[0] = code;
-			ppp_do_recv(pch->ppp, skb, pch);
+
+			/* Queue to channel. */
+			skb_queue_tail(&pch->file.rq, skb);
+			/* drop old frames if queue too long */
+			while (pch->file.rq.qlen > PPP_MAX_RQLEN
+				&& (skb = skb_dequeue(&pch->file.rq)) != 0)
+				kfree_skb(skb);
+			wake_up_interruptible(&pch->file.rwait);
 		}
 	}
 	read_unlock_bh(&pch->upl);
 }
 
 /*
  * We come in here to process a received frame.
  * The receive side of the ppp unit is locked.
  */
 static void
 ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
 {
 	if (skb->len >= 2) {
 #ifdef CONFIG_PPP_MULTILINK
 		/* XXX do channel-level decompression here */

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

* Re: Multilink and ppp_input_error().
  2004-11-09 17:12 Multilink and ppp_input_error() Matthew N. Dodd
@ 2004-11-09 23:01 ` Paul Mackerras
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mackerras @ 2004-11-09 23:01 UTC (permalink / raw)
  To: linux-ppp

Matthew N. Dodd writes:

> Has anyone else noticed that drivers/net/ppp_generic.c:ppp_input_error()
> is effectively a NOP?  pppd/main.c:get_input() treats a zero length

No it isn't a NOP, ppp_receive_frame calls ppp_receive_error when it
gets the 0-length skb, which resets the VJ decompression code (which
is what really needs to know about receive errors).

> packet as a hangup indication but if you trace out the call to
> ppp_do_recv() in ppp_input_error() the zero length frame is never sent
> to the file descriptor.  Further, calling an input function for the PPP
> device isn't useful as the intent is to deliver the error to a specific
> PPP channel.
> 
> I'm using the attached patch.
> 
> Comments?

You really want your link to terminate every time you get an FCS error
on a received packet?

Paul.

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

end of thread, other threads:[~2004-11-09 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-09 17:12 Multilink and ppp_input_error() Matthew N. Dodd
2004-11-09 23:01 ` Paul Mackerras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.