diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2016-03-18 21:54:23 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2016-03-18 21:54:23 +0300 |
commit | eb26d0d42c5cc1d0db5633ae5bf970c39614c0ca (patch) | |
tree | 64987aad95a3079cb780c650f858c5fe4b67db30 /accel-pppd | |
parent | 65c90307db554663964f1aa2624630433a98d040 (diff) | |
download | accel-ppp-eb26d0d42c5cc1d0db5633ae5bf970c39614c0ca.tar.gz accel-ppp-eb26d0d42c5cc1d0db5633ae5bf970c39614c0ca.zip |
ppp: call ap_session_finished before actual interface destroing
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/ppp/ppp.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index 916cf8b5..cb5577ec 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); |