diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2010-10-23 15:16:04 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2010-10-23 15:16:04 +0400 |
commit | a970c053a5c74d39ec5f6c14fb36b4f092eaf1b5 (patch) | |
tree | 3663cafa808021001f7b59cda458b84f5abc2ef3 /accel-pptpd/extra/pppd_compat.c | |
parent | ce95b416f4b6c5012073bb14c0b48c6b3a81fc33 (diff) | |
download | accel-ppp-a970c053a5c74d39ec5f6c14fb36b4f092eaf1b5.tar.gz accel-ppp-a970c053a5c74d39ec5f6c14fb36b4f092eaf1b5.zip |
pppd_compat: ip-pre-up call moved to proper place
ppp: don't negotiate mru after ConfNak received
Diffstat (limited to 'accel-pptpd/extra/pppd_compat.c')
-rw-r--r-- | accel-pptpd/extra/pppd_compat.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/accel-pptpd/extra/pppd_compat.c b/accel-pptpd/extra/pppd_compat.c index 017a8275..9655269a 100644 --- a/accel-pptpd/extra/pppd_compat.c +++ b/accel-pptpd/extra/pppd_compat.c @@ -113,7 +113,8 @@ static void ev_ppp_starting(struct ppp_t *ppp) pd->ip_change_hnd.handler = ip_change_handler; list_add_tail(&pd->pd.entry, &ppp->pd_list); } -static void ev_ppp_started(struct ppp_t *ppp) + +static void ev_ppp_pre_up(struct ppp_t *ppp) { pid_t pid; char *argv[8]; @@ -157,6 +158,28 @@ static void ev_ppp_started(struct ppp_t *ppp) } else log_error("pppd_compat: fork: %s\n", strerror(errno)); } +} + +static void ev_ppp_started(struct ppp_t *ppp) +{ + pid_t pid; + char *argv[8]; + char *env[2]; + char ipaddr[16]; + char peer_ipaddr[16]; + char peername[64]; + struct pppd_compat_pd_t *pd = find_pd(ppp); + + if (!pd) + return; + + argv[4] = ipaddr; + argv[5] = peer_ipaddr; + fill_argv(argv, ppp, conf_ip_up); + + env[0] = peername; + env[1] = NULL; + fill_env(env, pd); if (conf_ip_up) { sigchld_lock(); @@ -479,6 +502,7 @@ static void __init init(void) conf_verbose = 1; triton_event_register_handler(EV_PPP_STARTING, (triton_event_func)ev_ppp_starting); + triton_event_register_handler(EV_PPP_PRE_UP, (triton_event_func)ev_ppp_pre_up); triton_event_register_handler(EV_PPP_STARTED, (triton_event_func)ev_ppp_started); triton_event_register_handler(EV_PPP_FINISHING, (triton_event_func)ev_ppp_finishing); triton_event_register_handler(EV_PPP_FINISHED, (triton_event_func)ev_ppp_finished); |