summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-03-19 22:19:25 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-03-19 22:19:25 +0300
commitd392ccd024f9243bf5df8e242a5b0cb6a85876ba (patch)
treec1e3a53a690e83f8211bc89ce3084540a0792d13
parent3c07b3ea7659bd462ebf2bd946b5fcd10add7757 (diff)
downloadaccel-ppp-d392ccd024f9243bf5df8e242a5b0cb6a85876ba.tar.gz
accel-ppp-d392ccd024f9243bf5df8e242a5b0cb6a85876ba.zip
ppp: fix bug introduced by "call ap_session_finished before actual interface destroing"
-rw-r--r--accel-pppd/ppp/ppp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c
index cb5577ec..fe6d597e 100644
--- a/accel-pppd/ppp/ppp.c
+++ b/accel-pppd/ppp/ppp.c
@@ -236,6 +236,12 @@ static void destablish_ppp(struct ppp_t *ppp)
{
struct pppunit_cache *uc = NULL;
+ if (ppp->unit_fd < 0) {
+ ap_session_finished(&ppp->ses);
+ destroy_ppp_channel(ppp);
+ return;
+ }
+
if (conf_unit_cache) {
struct ifreq ifr;
@@ -250,11 +256,6 @@ static void destablish_ppp(struct ppp_t *ppp)
}
}
- 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);
@@ -267,11 +268,10 @@ static void destablish_ppp(struct ppp_t *ppp)
skip:
ppp->unit_fd = -1;
- log_ppp_debug("ppp destablished\n");
-
-destroy_channel:
destroy_ppp_channel(ppp);
+ log_ppp_debug("ppp destablished\n");
+
if (uc) {
pthread_mutex_lock(&uc_lock);
list_add_tail(&uc->entry, &uc_list);