From owner-freebsd-net@FreeBSD.ORG Sat Jul 24 02:47:29 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5748C16A4CE for ; Sat, 24 Jul 2004 02:47:29 +0000 (GMT) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id A925443D46 for ; Sat, 24 Jul 2004 02:47:28 +0000 (GMT) (envelope-from smckay@internode.on.net) Received: from dungeon.home (ppp228-230.lns1.bne1.internode.on.net [203.122.228.230])i6O2lQHY042446; Sat, 24 Jul 2004 12:17:26 +0930 (CST) Received: from dungeon.home (localhost [127.0.0.1]) by dungeon.home (8.12.8p2/8.11.6) with ESMTP id i6O2lQfJ007370; Sat, 24 Jul 2004 12:47:26 +1000 (EST) (envelope-from mckay) Message-Id: <200407240247.i6O2lQfJ007370@dungeon.home> To: freebsd-net@freebsd.org Date: Sat, 24 Jul 2004 12:47:26 +1000 From: Stephen McKay cc: Stephen McKay Subject: PPPoE problem: "Too many LQR packets lost" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2004 02:47:29 -0000 Hi! A few months ago my ADSL line started dropping out, claiming too many LQR packets lost. Seems like my telco changed the hardware at the other end. You get that a lot here. So, I just turned off LQR and left it at that. Unfortunately, when the other end loses its marbles the link just hangs now instead of ppp detecting it and reconnecting. I decided to patch ppp. I found Mike Tancsa's patch but didn't like it. I rolled my own, which seems to be working so far. It works by switching from LQR to simple echo requests when LQR times out. This should be tuned a bit so that people with working LQR (well, at least one correct LQR exchange in a given session) don't have to wait for the echo requests to time out too before a dead connection is detected. I'd have to have a carrier that supported LQR to test that though. :-) Stephen. (This is a patch against ppp in FreeBSD 4.8. I haven't tried the ppp in -current yet as -current is still a wild and woolly place that scares me.) Index: lqr.c =================================================================== RCS file: /cvs/src/usr.sbin/ppp/lqr.c,v retrieving revision 1.40.2.4 diff -u -r1.40.2.4 lqr.c --- lqr.c 1 Sep 2002 02:12:28 -0000 1.40.2.4 +++ lqr.c 24 Jul 2004 02:12:51 -0000 @@ -165,8 +165,16 @@ lcp->fsm.link->name); log_Printf(LogLQM, "%s: Too many LQR packets lost\n", lcp->fsm.link->name); - p->hdlc.lqm.method = 0; - datalink_Down(p->dl, CLOSE_NORMAL); + p->hdlc.lqm.method &= ~LQM_LQR; + if (p->hdlc.lqm.method == 0) + datalink_Down(p->dl, CLOSE_NORMAL); + else { + log_Printf(LogPHASE, "%s: ** Switching to LQR ECHO **\n", + lcp->fsm.link->name); + log_Printf(LogLQM, "%s: Switching to LQR ECHO\n", + lcp->fsm.link->name); + SendEchoReq(lcp); + } } else { SendLqrData(lcp); p->hdlc.lqm.lqr.resent++;