summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2014-04-08 23:07:15 +0200
committerDmitry Kozlov <xeb@mail.ru>2014-04-11 06:47:42 +0400
commit19cff977b7c249e69626bce816baac3eb7a71d3f (patch)
tree9f0afe55073ca935c5ee60458c02b6e954daaf12 /accel-pppd/ctrl
parent6677ca651c0c014375b71acda296c7f565878336 (diff)
downloadaccel-ppp-19cff977b7c249e69626bce816baac3eb7a71d3f.tar.gz
accel-ppp-19cff977b7c249e69626bce816baac3eb7a71d3f.zip
l2tp: configure receive window in accel-ppp.conf
Add the recv-window option in accel-ppp.conf. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index a61694db..97164746 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);