From 9596fe66415eb97e70cbbafc08c2af387aea062b Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Mon, 22 May 2006 00:04:07 +0000 Subject: [PATCH 1/1] This enables plugins called via hooks/notifiers triggered by the calls to lcp_close() to see the changed "status" value. Otherwise (i. e. without this patch) the RADIUS plugin cannot set the attribute PW_ACCT_TERMINATE_CAUSE to the appropriate values. Patch from Robert Vogelgesang. --- pppd/auth.c | 12 ++++++------ pppd/cbcp.c | 4 ++-- pppd/lcp.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pppd/auth.c b/pppd/auth.c index a6f7d1c..8e1180d 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -68,7 +68,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: auth.c,v 1.108 2005/08/28 05:22:48 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.109 2006/05/22 00:04:07 paulus Exp $" #include #include @@ -746,8 +746,8 @@ link_established(unit) set_allowed_addrs(unit, NULL, NULL); } else if (!wo->neg_upap || uselogin || !null_login(unit)) { warn("peer refused to authenticate: terminating link"); - lcp_close(unit, "peer refused to authenticate"); status = EXIT_PEER_AUTH_FAILED; + lcp_close(unit, "peer refused to authenticate"); return; } } @@ -906,8 +906,8 @@ auth_peer_fail(unit, protocol) /* * Authentication failure: take the link down */ - lcp_close(unit, "Authentication failed"); status = EXIT_PEER_AUTH_FAILED; + lcp_close(unit, "Authentication failed"); } /* @@ -984,8 +984,8 @@ auth_withpeer_fail(unit, protocol) * is no point in persisting without any way to get updated * authentication secrets. */ - lcp_close(unit, "Failed to authenticate ourselves to peer"); status = EXIT_AUTH_TOPEER_FAILED; + lcp_close(unit, "Failed to authenticate ourselves to peer"); } /* @@ -1149,9 +1149,9 @@ check_maxoctets(arg) diff = maxoctets - used; if(diff < 0) { notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); + status = EXIT_TRAFFIC_LIMIT; lcp_close(0, "Traffic limit"); need_holdoff = 0; - status = EXIT_TRAFFIC_LIMIT; } else { TIMEOUT(check_maxoctets, NULL, maxoctets_timeout); } @@ -1181,9 +1181,9 @@ check_idle(arg) if (tlim <= 0) { /* link is idle: shut it down. */ notice("Terminating connection due to lack of activity."); + status = EXIT_IDLE_TIMEOUT; lcp_close(0, "Link inactive"); need_holdoff = 0; - status = EXIT_IDLE_TIMEOUT; } else { TIMEOUT(check_idle, NULL, tlim); } diff --git a/pppd/cbcp.c b/pppd/cbcp.c index ab069d4..7f2f787 100644 --- a/pppd/cbcp.c +++ b/pppd/cbcp.c @@ -33,7 +33,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: cbcp.c,v 1.16 2004/10/28 00:15:36 paulus Exp $" +#define RCSID "$Id: cbcp.c,v 1.17 2006/05/22 00:04:07 paulus Exp $" #include #include @@ -483,6 +483,6 @@ cbcp_up(us) cbcp_state *us; { persist = 0; - lcp_close(0, "Call me back, please"); status = EXIT_CALLBACK; + lcp_close(0, "Call me back, please"); } diff --git a/pppd/lcp.c b/pppd/lcp.c index e70dcec..995ba73 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: lcp.c,v 1.75 2004/11/14 22:53:42 carlsonj Exp $" +#define RCSID "$Id: lcp.c,v 1.76 2006/05/22 00:04:07 paulus Exp $" /* * TODO: @@ -1305,8 +1305,8 @@ lcp_nakci(f, p, len, treat_as_reject) if (looped_back) { if (++try.numloops >= lcp_loopbackfail) { notice("Serial line is looped back."); - lcp_close(f->unit, "Loopback detected"); status = EXIT_LOOPBACK; + lcp_close(f->unit, "Loopback detected"); } } else try.numloops = 0; @@ -2233,8 +2233,8 @@ void LcpLinkFailure (f) if (f->state == OPENED) { info("No response to %d echo-requests", lcp_echos_pending); notice("Serial link appears to be disconnected."); - lcp_close(f->unit, "Peer not responding"); status = EXIT_PEER_DEAD; + lcp_close(f->unit, "Peer not responding"); } } -- 2.39.2