diff options
-rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 5 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp.h | 1 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp_lcp.c | 2 | ||||
-rw-r--r-- | accel-pppd/radius/acct.c | 3 |
4 files changed, 9 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index 687aecbc..17087fa2 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -83,7 +83,7 @@ static void disconnect(struct pptp_conn_t *conn) if (conn->state == STATE_PPP) { __sync_sub_and_fetch(&stat_active, 1); conn->state = STATE_CLOSE; - ppp_terminate(&conn->ppp, TERM_USER_REQUEST, 1); + ppp_terminate(&conn->ppp, TERM_LOST_CARRIER, 1); } else if (conn->state != STATE_CLOSE) __sync_sub_and_fetch(&stat_starting, 1); @@ -366,6 +366,9 @@ static int pptp_call_clear_rqst(struct pptp_conn_t *conn) if (conf_verbose) log_ppp_info2("recv [PPTP Call-Clear-Request <Call-ID %x>]\n", ntohs(rqst->call_id)); + if (conn->echo_timer.tpd) + triton_timer_del(&conn->echo_timer); + if (conn->state == STATE_PPP) { __sync_sub_and_fetch(&stat_active, 1); conn->state = STATE_CLOSE; diff --git a/accel-pppd/ppp/ppp.h b/accel-pppd/ppp/ppp.h index 5fee8a41..8556b2c2 100644 --- a/accel-pppd/ppp/ppp.h +++ b/accel-pppd/ppp/ppp.h @@ -54,6 +54,7 @@ #define TERM_NAS_REQUEST 6 #define TERM_NAS_REBOOT 7 #define TERM_AUTH_ERROR 8 +#define TERM_LOST_CARRIER 9 struct ppp_t; diff --git a/accel-pppd/ppp/ppp_lcp.c b/accel-pppd/ppp/ppp_lcp.c index 63fe8fff..10e25fb1 100644 --- a/accel-pppd/ppp/ppp_lcp.c +++ b/accel-pppd/ppp/ppp_lcp.c @@ -615,7 +615,7 @@ static void send_echo_request(struct triton_timer_t *t) if (++lcp->echo_sent > lcp->echo_failure) { log_ppp_warn("lcp: no echo reply\n"); - ppp_terminate(lcp->ppp, TERM_USER_ERROR, 1); + ppp_terminate(lcp->ppp, TERM_LOST_CARRIER, 1); } else { if (conf_ppp_verbose) log_ppp_debug("send [LCP EchoReq id=%x <magic %x>]\n", msg.hdr.id, msg.magic); diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c index cbb23d53..40f6f810 100644 --- a/accel-pppd/radius/acct.c +++ b/accel-pppd/radius/acct.c @@ -289,6 +289,9 @@ void rad_acct_stop(struct radius_pd_t *rpd) case TERM_NAS_REBOOT: rad_packet_add_val(rpd->acct_req->pack, NULL, "Acct-Terminate-Cause", "NAS-Reboot"); break; + case TERM_LOST_CARRIER: + rad_packet_add_val(rpd->acct_req->pack, NULL, "Acct-Terminate-Cause", "Lost-Carrier"); + break; } rad_packet_change_val(rpd->acct_req->pack, NULL, "Acct-Status-Type", "Stop"); req_set_stat(rpd->acct_req, rpd->ppp); |