summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-07-31 17:09:29 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-07-31 17:09:29 +0300
commit15a3f6941ca8d1bfaf2e0f09cc3fa9edb8fd5c4f (patch)
treecd73fc67a1eb5de538aaa1c6fc89d1f318b92adf /accel-pppd
parent2763a35fc00ef18e91a3c6e55f0568d40b55f717 (diff)
parent6c514056471dfdf030d69fb9fda443047a8cc964 (diff)
downloadaccel-ppp-15a3f6941ca8d1bfaf2e0f09cc3fa9edb8fd5c4f.tar.gz
accel-ppp-15a3f6941ca8d1bfaf2e0f09cc3fa9edb8fd5c4f.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.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c
index 2db24403..318327e8 100644
--- a/accel-pppd/extra/pppd_compat.c
+++ b/accel-pppd/extra/pppd_compat.c
@@ -238,7 +238,7 @@ static void ev_ses_pre_up(struct ap_session *ses)
argv[4] = ipaddr;
argv[5] = peer_ipaddr;
- fill_argv(argv, pd, conf_ip_up);
+ fill_argv(argv, pd, conf_ip_pre_up);
fill_env(env, env_mem, pd);
@@ -269,7 +269,10 @@ static void ev_ses_pre_up(struct ap_session *ses)
sigfillset(&set);
pthread_sigmask(SIG_UNBLOCK, &set, NULL);
+ net->enter_ns();
execve(conf_ip_pre_up, argv, env);
+ net->exit_ns();
+
log_emerg("pppd_compat: exec '%s': %s\n", conf_ip_pre_up, strerror(errno));
_exit(EXIT_FAILURE);
} else
@@ -316,7 +319,10 @@ static void ev_ses_started(struct ap_session *ses)
sigfillset(&set);
pthread_sigmask(SIG_UNBLOCK, &set, NULL);
+ net->enter_ns();
execve(conf_ip_up, argv, env);
+ net->exit_ns();
+
log_emerg("pppd_compat: exec '%s': %s\n", conf_ip_up, strerror(errno));
_exit(EXIT_FAILURE);
} else
@@ -373,7 +379,10 @@ static void ev_ses_finished(struct ap_session *ses)
sigfillset(&set);
pthread_sigmask(SIG_UNBLOCK, &set, NULL);
+ net->enter_ns();
execve(conf_ip_down, argv, env);
+ net->exit_ns();
+
log_emerg("pppd_compat: exec '%s': %s\n", conf_ip_down, strerror(errno));
_exit(EXIT_FAILURE);
} else
@@ -445,8 +454,8 @@ static void ev_radius_coa(struct ev_radius_t *ev)
check_fork_limit(pd, &queue1);
sigchld_lock();
- pid = fork();
- if (pid > 0) {
+ pid = fork();
+ if (pid > 0) {
pd->hnd.pid = pid;
pd->hnd.handler = ip_change_handler;
sigchld_register_handler(&pd->hnd);
@@ -459,7 +468,10 @@ static void ev_radius_coa(struct ev_radius_t *ev)
if (!ev->res)
ev->res = pd->res;
} else if (pid == 0) {
+ net->enter_ns();
execve(conf_ip_change, argv, env);
+ net->exit_ns();
+
log_emerg("pppd_compat: exec '%s': %s\n", conf_ip_change, strerror(errno));
_exit(EXIT_FAILURE);
} else