diff options
-rw-r--r-- | accel-pppd/accel-ppp.conf | 1 | ||||
-rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 6 | ||||
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 9 |
3 files changed, 15 insertions, 1 deletions
diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf index a5f7e801..e7daf62f 100644 --- a/accel-pppd/accel-ppp.conf +++ b/accel-pppd/accel-ppp.conf @@ -84,6 +84,7 @@ verbose=1 #timeout=60 #rtimeout=5 #retransmit=5 +#recv-window=16 #host-name=accel-ppp #dir300_quirk=0 #secret= diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index 01ca8693..9cabadab 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -477,6 +477,12 @@ This name will be sent to clients in Host-Name attribute. .BI "hello-interval=" n Specifies interval (in seconds) to send Hello control message. Its used for keep alive connection. If peer will not respond to Hello connection will be terminated. .TP +.BI "recv-window=" n +Set the size of the local receive window. Only received messages whose sequence +number is in the range [last-Nr + 1, last-Nr + recv-window] are accepted +(where last-Nr is the sequence number of the last acknowledged message). +Minimum value is 1, maximum is 32768, default is 16. +.TP .BI "timeout=" n Specifies timeout (in seconds) to wait peer completes tunnel and session negotiation. .TP 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); |