diff options
author | xebd <xeb@mail.ru> | 2018-02-15 10:27:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-15 10:27:12 +0300 |
commit | 608a9cf16df4dd9d806b7cf1225cca2490f8dc99 (patch) | |
tree | c553a9a964de70f7485493bb1106fc845444eee9 | |
parent | 946bc4d4c33b0467eb9c3133e7251d8ed3e03a9d (diff) | |
parent | 4fc2be2b3b2a7c8af8cf667e2c4a87e03d95c9e4 (diff) | |
download | accel-ppp-608a9cf16df4dd9d806b7cf1225cca2490f8dc99.tar.gz accel-ppp-608a9cf16df4dd9d806b7cf1225cca2490f8dc99.zip |
Merge pull request #39 from themiron/pptp-max-mtu
pptp: add the ppp-max-mtu option to match l2tp & sstp
-rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 4 | ||||
-rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index 56b8bee9..5bf7282d 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -475,6 +475,10 @@ Timeout waiting reply from client in seconds (default 5). If this option is given ppp interface will be renamed using .B ifname as a template, i.e pptp%d => pptp0. +.TP +.BI "ppp-max-mtu=" n +Set the maximun MTU value that can be negociated for PPP over PPTP +sessions. Default value is 1436. .SH [pppoe] .br Configuration of PPPoE module. diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index 88b3759a..7ca4b77a 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -55,6 +55,7 @@ struct pptp_conn_t struct ppp_t ppp; }; +static int conf_ppp_max_mtu = PPTP_MAX_MTU; static int conf_timeout = 5; static int conf_echo_interval = 0; static int conf_echo_failure = 3; @@ -688,7 +689,7 @@ static int pptp_connect(struct triton_md_handler_t *h) conn->ctrl.started = ppp_started; conn->ctrl.finished = ppp_finished; conn->ctrl.terminate = ppp_terminate; - conn->ctrl.max_mtu = PPTP_MAX_MTU; + conn->ctrl.max_mtu = conf_ppp_max_mtu; conn->ctrl.type = CTRL_TYPE_PPTP; conn->ctrl.ppp = 1; conn->ctrl.name = "pptp"; @@ -770,6 +771,12 @@ static void load_config(void) if (opt && atoi(opt) >= 0) conf_verbose = atoi(opt) > 0; + opt = conf_get_opt("pptp", "ppp-max-mtu"); + if (opt && atoi(opt) > 0) + conf_ppp_max_mtu = atoi(opt); + else + conf_ppp_max_mtu = PPTP_MAX_MTU; + conf_mppe = MPPE_UNSET; opt = conf_get_opt("pptp", "mppe"); if (opt) { |