From eb26d0d42c5cc1d0db5633ae5bf970c39614c0ca Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Fri, 18 Mar 2016 21:54:23 +0300 Subject: ppp: call ap_session_finished before actual interface destroing --- accel-pppd/ppp/ppp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index 916cf8b..cb5577e 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -230,17 +230,12 @@ static void destroy_ppp_channel(struct ppp_t *ppp) _free_layers(ppp); mempool_free(ppp->buf); - - ap_session_finished(&ppp->ses); } static void destablish_ppp(struct ppp_t *ppp) { struct pppunit_cache *uc = NULL; - if (ppp->unit_fd < 0) - goto destroy_channel; - if (conf_unit_cache) { struct ifreq ifr; @@ -249,10 +244,18 @@ static void destablish_ppp(struct ppp_t *ppp) strncpy(ifr.ifr_name, ppp->ses.ifname, IFNAMSIZ); if (net->sock_ioctl(SIOCSIFNAME, &ifr)) { triton_md_unregister_handler(&ppp->unit_hnd, 1); + ap_session_finished(&ppp->ses); goto skip; } } + } + ap_session_finished(&ppp->ses); + + if (ppp->unit_fd < 0) + goto destroy_channel; + + if (conf_unit_cache) { triton_md_unregister_handler(&ppp->unit_hnd, 0); uc = mempool_alloc(uc_pool); -- cgit v1.2.3