From 05c09ae62d0b4ff67fb26c37a01e6a07bb593c0c Mon Sep 17 00:00:00 2001 From: "David F. Skoll" Date: Mon, 24 Jun 2002 12:57:15 +0000 Subject: [PATCH] Patches from Frank Cusack: - Avoid infinite loop (eventually running out of stack space) when doing callback into ccp with MPPE enabled, by updating lcp_fsm state *before* doing callbacks. Problem noted by Rustem Yumaev . - Add missing accounting attributes - Update for newer automake; required to compile on RH 7.3 --- pppd/ccp.c | 12 ++++++++---- pppd/fsm.c | 6 +++--- pppd/plugins/radius/radiusclient/aclocal.m4 | 2 +- pppd/plugins/radius/radiusclient/etc/dictionary | 2 ++ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pppd/ccp.c b/pppd/ccp.c index 3e408ba..8ff92f3 100644 --- a/pppd/ccp.c +++ b/pppd/ccp.c @@ -25,7 +25,7 @@ * OR MODIFICATIONS. */ -#define RCSID "$Id: ccp.c,v 1.36 2002/05/28 17:00:57 dfs Exp $" +#define RCSID "$Id: ccp.c,v 1.37 2002/06/24 12:57:15 dfs Exp $" #include #include @@ -37,7 +37,7 @@ #ifdef MPPE #include "chap_ms.h" /* mppe_xxxx_key */ -#include "lcp.h" /* lcp_close() */ +#include "lcp.h" /* lcp_close(), lcp_fsm */ #endif static const char rcsid[] = RCSID; @@ -1438,8 +1438,12 @@ ccp_down(f) ccp_flags_set(f->unit, 1, 0); #ifdef MPPE if (ccp_gotoptions[f->unit].mppe) { - error("MPPE disabled"); - lcp_close(f->unit, "MPPE disabled"); + ccp_gotoptions[f->unit].mppe = 0; + if (lcp_fsm[f->unit].state == OPENED) { + /* If LCP is not already going down, make sure it does. */ + error("MPPE disabled"); + lcp_close(f->unit, "MPPE disabled"); + } } #endif } diff --git a/pppd/fsm.c b/pppd/fsm.c index b5b8148..6c74036 100644 --- a/pppd/fsm.c +++ b/pppd/fsm.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: fsm.c,v 1.17 1999/08/13 06:46:12 paulus Exp $" +#define RCSID "$Id: fsm.c,v 1.18 2002/06/24 12:57:15 dfs Exp $" /* * TODO: @@ -562,10 +562,10 @@ fsm_rtermreq(f, id, p, len) info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); } else info("%s terminated by peer", PROTO_NAME(f)); - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ f->retransmits = 0; f->state = STOPPING; + if (f->callbacks->down) + (*f->callbacks->down)(f); /* Inform upper layers */ TIMEOUT(fsm_timeout, f, f->timeouttime); break; } diff --git a/pppd/plugins/radius/radiusclient/aclocal.m4 b/pppd/plugins/radius/radiusclient/aclocal.m4 index 5532ad1..6cb12d4 100644 --- a/pppd/plugins/radius/radiusclient/aclocal.m4 +++ b/pppd/plugins/radius/radiusclient/aclocal.m4 @@ -20,7 +20,7 @@ dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, -[AC_REQUIRE([AM_PROG_INSTALL]) +[AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] diff --git a/pppd/plugins/radius/radiusclient/etc/dictionary b/pppd/plugins/radius/radiusclient/etc/dictionary index b8d7771..8de308c 100644 --- a/pppd/plugins/radius/radiusclient/etc/dictionary +++ b/pppd/plugins/radius/radiusclient/etc/dictionary @@ -77,6 +77,8 @@ ATTRIBUTE Acct-Output-Octets 43 integer ATTRIBUTE Acct-Session-Id 44 string ATTRIBUTE Acct-Authentic 45 integer ATTRIBUTE Acct-Session-Time 46 integer +ATTRIBUTE Acct-Input-Packets 47 integer +ATTRIBUTE Acct-Output-Packets 48 integer ATTRIBUTE Acct-Terminate-Cause 49 integer ATTRIBUTE Chap-Challenge 60 string ATTRIBUTE NAS-Port-Type 61 integer -- 2.39.2