From 19cff977b7c249e69626bce816baac3eb7a71d3f Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Tue, 8 Apr 2014 23:07:15 +0200 Subject: l2tp: configure receive window in accel-ppp.conf Add the recv-window option in accel-ppp.conf. Signed-off-by: Guillaume Nault --- accel-pppd/ctrl/l2tp/l2tp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'accel-pppd/ctrl') diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index a61694d..9716474 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -73,6 +73,7 @@ int conf_verbose = 0; int conf_hide_avps = 0; int conf_avp_permissive = 0; +static uint16_t conf_recv_window = DEFAULT_RECV_WINDOW; static int conf_ppp_max_mtu = DEFAULT_PPP_MAX_MTU; static int conf_port = L2TP_PORT; static int conf_ephemeral_ports = 0; @@ -1624,7 +1625,7 @@ static struct l2tp_conn_t *l2tp_tunnel_alloc(const struct sockaddr_in *peer, goto err_conn_fd; } - conn->recv_queue_sz = DEFAULT_RECV_WINDOW; + conn->recv_queue_sz = conf_recv_window; conn->recv_queue = _malloc(conn->recv_queue_sz * sizeof(*conn->recv_queue)); if (conn->recv_queue == NULL) { @@ -4697,6 +4698,12 @@ static void load_config(void) if (opt && atoi(opt) > 0) conf_retransmit = atoi(opt); + opt = conf_get_opt("l2tp", "recv-window"); + if (opt && atoi(opt) > 0 && atoi(opt) <= RECV_WINDOW_SIZE_MAX) + conf_recv_window = atoi(opt); + else + conf_recv_window = DEFAULT_RECV_WINDOW; + opt = conf_get_opt("l2tp", "ppp-max-mtu"); if (opt && atoi(opt) > 0) conf_ppp_max_mtu = atoi(opt); -- cgit v1.2.3