diff --git a/accel-pptpd/logs/log_file.c b/accel-pptpd/logs/log_file.c index 7287f5b977573e34589a0230c5dffed5baec10b3..c559d4d43960f53717a0ec70e36f6f5c5577768a 100644 --- a/accel-pptpd/logs/log_file.c +++ b/accel-pptpd/logs/log_file.c @@ -203,6 +203,7 @@ static void send_next_chunk(void) close(lf->fd); lf->fd = lf->new_fd; lf->new_fd = -1; + lf->offset = 0; } aiocb.aio_fildes = lf->fd; @@ -335,7 +336,6 @@ static void general_reopen(void) return; } log_file->new_fd = fd; - log_file->offset = 0; } static void free_lpd(struct log_file_pd_t *lpd) diff --git a/accel-pptpd/ppp/lcp_opt_mru.c b/accel-pptpd/ppp/lcp_opt_mru.c index 7ab75f9eba04213f81c50c6f70634051a750f53f..6a8c430fe5960a18f03a7ed1bba1894154467f40 100644 --- a/accel-pptpd/ppp/lcp_opt_mru.c +++ b/accel-pptpd/ppp/lcp_opt_mru.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -167,6 +168,21 @@ static void __init mru_opt_init() opt = conf_get_opt("ppp", "max-mtu"); if (opt && atoi(opt) > 0) conf_max_mtu = atoi(opt); + + if (conf_min_mtu > conf_mru) { + log_emerg("min-mtu cann't be greater then mtu/mru\n"); + _exit(-1); + } + + if (conf_min_mtu > 1500) { + log_emerg("min-mtu cann't be greater then 1500\n"); + _exit(-1); + } + + if (conf_mru > 1500 || conf_mtu > 1500) { + log_emerg("mtu/mru cann't be greater then 1500\n"); + _exit(-1); + } lcp_option_register(&mru_opt_hnd); } diff --git a/accel-pptpd/ppp/ppp_fsm.c b/accel-pptpd/ppp/ppp_fsm.c index 46b6215413835175882d88de0e736e2c9f4b5c4e..24e914fa5b1031fb5fac4ce9f0ca353995a7504a 100644 --- a/accel-pptpd/ppp/ppp_fsm.c +++ b/accel-pptpd/ppp/ppp_fsm.c @@ -11,8 +11,8 @@ #include "memdebug.h" static int conf_max_terminate = 2; -static int conf_max_configure = 5; -static int conf_max_failure = 5; +static int conf_max_configure = 10; +static int conf_max_failure = 10; static int conf_timeout = 5; void send_term_req(struct ppp_fsm_t *layer); @@ -253,6 +253,10 @@ void ppp_fsm_recv_conf_req_nak(struct ppp_fsm_t *layer) break; case FSM_Req_Sent: case FSM_Ack_Rcvd: + if (++layer->conf_failure == layer->max_failure) { + if (layer->layer_finished) layer->layer_finished(layer); + return; + } if (layer->send_conf_nak) layer->send_conf_nak(layer); break; case FSM_Opened: @@ -290,7 +294,7 @@ void ppp_fsm_recv_conf_req_rej(struct ppp_fsm_t *layer) case FSM_Req_Sent: case FSM_Ack_Rcvd: if (++layer->conf_failure == layer->max_failure) { - if (layer->layer_down) layer->layer_down(layer); + if (layer->layer_finished) layer->layer_finished(layer); return; } if (layer->send_conf_rej) layer->send_conf_rej(layer);