summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-07-14 20:49:00 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-07-14 20:49:00 +0300
commit1dce3168c8a43ba1ef6d2b78355933aafc35d3f9 (patch)
tree92338dc0dd5ff73a32bfa8cec5189ef513a524ad /accel-pppd/ppp
parent33757db5ed54d22eaf4ab3911c70d51176f055c0 (diff)
downloadaccel-ppp-1dce3168c8a43ba1ef6d2b78355933aafc35d3f9.tar.gz
accel-ppp-1dce3168c8a43ba1ef6d2b78355933aafc35d3f9.zip
ppp: code simplification
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r--accel-pppd/ppp/ppp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c
index d39e39d8..e511bf86 100644
--- a/accel-pppd/ppp/ppp.c
+++ b/accel-pppd/ppp/ppp.c
@@ -251,7 +251,6 @@ static void destablish_ppp(struct ppp_t *ppp)
if (net->move_link(def_net, ppp->ses.ifindex)) {
log_ppp_warn("failed to attach to default namespace\n");
triton_md_unregister_handler(&ppp->unit_hnd, 1);
- ap_session_finished(&ppp->ses);
goto skip;
}
ppp->ses.net = def_net;
@@ -264,14 +263,11 @@ static void destablish_ppp(struct ppp_t *ppp)
if (net->sock_ioctl(SIOCSIFNAME, &ifr)) {
log_ppp_warn("failed to rename ppp to default name\n");
triton_md_unregister_handler(&ppp->unit_hnd, 1);
- ap_session_finished(&ppp->ses);
goto skip;
}
}
}
- ap_session_finished(&ppp->ses);
-
if (conf_unit_cache) {
triton_md_unregister_handler(&ppp->unit_hnd, 0);
@@ -282,6 +278,8 @@ static void destablish_ppp(struct ppp_t *ppp)
triton_md_unregister_handler(&ppp->unit_hnd, 1);
skip:
+ ap_session_finished(&ppp->ses);
+
ppp->unit_fd = -1;
destroy_ppp_channel(ppp);