diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2017-10-16 16:54:21 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2017-10-16 16:54:21 +0300 |
commit | 05cbd57477af3b90ee43817c8db4b3ca391414fd (patch) | |
tree | f16e95442dcdf83ed0183ec14f91232733712a14 /accel-pppd | |
parent | 55694075e77a4c70f99b97175d839bd556f9f1b4 (diff) | |
parent | 3abdeb226386bae855446c583b6dafd152b54c9d (diff) | |
download | accel-ppp-05cbd57477af3b90ee43817c8db4b3ca391414fd.tar.gz accel-ppp-05cbd57477af3b90ee43817c8db4b3ca391414fd.zip |
Merge branch 'master' of ssh://git.code.sf.net/p/accel-ppp/code
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/extra/pppd_compat.c | 10 | ||||
-rw-r--r-- | accel-pppd/session.c | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c index 0aca3e6e..58581899 100644 --- a/accel-pppd/extra/pppd_compat.c +++ b/accel-pppd/extra/pppd_compat.c @@ -262,6 +262,8 @@ static void ev_ses_pre_up(struct ap_session *ses) ap_session_terminate(ses, pd->res > 127 ? TERM_NAS_ERROR : TERM_ADMIN_RESET, 0); return; } + + pd->started = 1; } else if (pid == 0) { sigset_t set; sigfillset(&set); @@ -318,8 +320,6 @@ static void ev_ses_started(struct ap_session *ses) _exit(EXIT_FAILURE); } else log_error("pppd_compat: fork: %s\n", strerror(errno)); - - pd->started = 1; } static void ev_ses_finished(struct ap_session *ses) @@ -335,7 +335,7 @@ static void ev_ses_finished(struct ap_session *ses) if (!pd) return; - if (pd->started) { + if (pd->ip_up_hnd.pid) { pthread_mutex_lock(&pd->ip_up_hnd.lock); if (pd->ip_up_hnd.pid) { log_ppp_warn("pppd_compat: ip-up is not yet finished, terminating it ...\n"); @@ -344,7 +344,7 @@ static void ev_ses_finished(struct ap_session *ses) pthread_mutex_unlock(&pd->ip_up_hnd.lock); } - if (conf_ip_down) { + if (pd->started && conf_ip_down) { argv[4] = ipaddr; argv[5] = peer_ipaddr; fill_argv(argv, pd, conf_ip_down); @@ -379,7 +379,7 @@ static void ev_ses_finished(struct ap_session *ses) log_error("pppd_compat: fork: %s\n", strerror(errno)); } - if (pd->started) { + if (pd->ip_up_hnd.pid) { pthread_mutex_lock(&pd->ip_up_hnd.lock); if (pd->ip_up_hnd.pid) { log_ppp_warn("pppd_compat: ip-up is not yet finished, killing it ...\n"); diff --git a/accel-pppd/session.c b/accel-pppd/session.c index 1d25c3a3..3c559398 100644 --- a/accel-pppd/session.c +++ b/accel-pppd/session.c @@ -421,6 +421,10 @@ int __export ap_session_set_username(struct ap_session *s, char *username) _free(username); return -1; } else { + if (!ses->wakeup) { + ses->wakeup = s->ctrl->ctx; + wait = 1; + } ap_session_ifdown(ses); triton_context_call(ses->ctrl->ctx, (triton_event_func)__terminate_sec, ses); continue; |