X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fauth.c;h=8e1180ddaa49c7894051e95c08a9fe048890cecf;hb=d929a8d4e1d3e5ff15068ea3b538598b6d448943;hp=9f677c2f37330743a216e0f72e91cd19042bdbd7;hpb=cf141d059db0db1419e99b99099389c4c2e0ca0f;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index 9f677c2..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.106 2005/07/13 10:41:58 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.109 2006/05/22 00:04:07 paulus Exp $" #include #include @@ -652,6 +652,8 @@ link_terminated(unit) the_channel->disconnect(); devfd = -1; } + if (the_channel->cleanup) + (*the_channel->cleanup)(); if (doing_multilink && multilink_master) { if (!bundle_terminating) @@ -744,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; } } @@ -904,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"); } /* @@ -982,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"); } /* @@ -1147,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); } @@ -1179,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); } @@ -2558,5 +2560,5 @@ auth_script(script) argv[5] = strspeed; argv[6] = NULL; - auth_script_pid = run_program(script, argv, 0, auth_script_done, NULL); + auth_script_pid = run_program(script, argv, 0, auth_script_done, NULL, 0); }