summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-03-18 21:54:23 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-03-18 21:54:23 +0300
commiteb26d0d42c5cc1d0db5633ae5bf970c39614c0ca (patch)
tree64987aad95a3079cb780c650f858c5fe4b67db30
parent65c90307db554663964f1aa2624630433a98d040 (diff)
downloadaccel-ppp-eb26d0d42c5cc1d0db5633ae5bf970c39614c0ca.tar.gz
accel-ppp-eb26d0d42c5cc1d0db5633ae5bf970c39614c0ca.zip
ppp: call ap_session_finished before actual interface destroing
-rw-r--r--accel-pppd/ppp/ppp.c13
1 files 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);