summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2013-07-23 20:35:14 +0200
committerDmitry Kozlov <xeb@mail.ru>2013-07-24 22:32:08 +0400
commit4e6cf832cddf523c233ff0f0f3b244e077d87df3 (patch)
tree34afb7f2c7bd8785ea5deb4121aae7d7930ce259 /accel-pppd
parentca2e87fc65cc1b275b127ccee72e51b541b667bb (diff)
downloadaccel-ppp-4e6cf832cddf523c233ff0f0f3b244e077d87df3.tar.gz
accel-ppp-4e6cf832cddf523c233ff0f0f3b244e077d87df3.zip
l2tp: Add the ppp-max-mtu option
As the maximum acceptable MTU for an L2TP link may vary depending on IP and L2TP packet headers options, it is better to make it configurable so that an administrator can adapt it to its network constraints. Use the original value (1420) as default. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/accel-ppp.conf.54
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c11
2 files changed, 14 insertions, 1 deletions
diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5
index 2faf2ab7..9f7740a3 100644
--- a/accel-pppd/accel-ppp.conf.5
+++ b/accel-pppd/accel-ppp.conf.5
@@ -463,6 +463,10 @@ Specifies if an arbitrary source port is used when replying to a tunnel
establishment request. When this option is deactivated, the destination
port of the incoming request (SCCRQ) is used as source port for the
reply (SCCRP). Default value is 0.
+.TP
+.BI "ppp-max-mtu=" n
+Set the maximun MTU value that can be negociated for PPP over L2TP
+sessions. Default value is 1420.
.SH [radius]
.br
Configuration of RADIUS module.
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index 29ba76cc..b4b20b72 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -48,9 +48,12 @@
#define STATE_FIN 9
#define STATE_CLOSE 0
+#define DEFAULT_PPP_MAX_MTU 1420
+
int conf_verbose = 0;
int conf_hide_avps = 0;
int conf_avp_permissive = 0;
+static int conf_ppp_max_mtu = DEFAULT_PPP_MAX_MTU;
static int conf_port = L2TP_PORT;
static int conf_ephemeral_ports = 0;
static int conf_timeout = 60;
@@ -878,7 +881,7 @@ static struct l2tp_sess_t *l2tp_tunnel_alloc_session(struct l2tp_conn_t *conn)
sess->ctrl.started = l2tp_ppp_started;
sess->ctrl.finished = l2tp_ppp_finished;
sess->ctrl.terminate = ppp_terminate;
- sess->ctrl.max_mtu = 1420;
+ sess->ctrl.max_mtu = conf_ppp_max_mtu;
sess->ctrl.mppe = conf_mppe;
sess->ctrl.calling_station_id = _malloc(17);
sess->ctrl.called_station_id = _malloc(17);
@@ -3813,6 +3816,12 @@ static void load_config(void)
if (opt && atoi(opt) > 0)
conf_retransmit = atoi(opt);
+ opt = conf_get_opt("l2tp", "ppp-max-mtu");
+ if (opt && atoi(opt) > 0)
+ conf_ppp_max_mtu = atoi(opt);
+ else
+ conf_ppp_max_mtu = DEFAULT_PPP_MAX_MTU;
+
opt = conf_get_opt("l2tp", "host-name");
if (opt)
conf_host_name = opt;