aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2019-10-30 17:25:24 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-11-05 10:37:25 +0000
commiteaec04895edb90eb097b1f01481edf79ff03d42d (patch)
tree18b912ed17a26e028c36ef5cb351c8a3a1442458 /src
parent00413d3fed1fc258f836b72297ee8edddc1a9548 (diff)
tcp: rx fifo size is u32
- Limit cli input for rx fifo size to u32 Type: fix Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: If5a8e0668acf5b0f369acf4f120e47a012bd1899 (cherry picked from commit db39656d7a85ac6e9e6fbed9ea59b3089acc8cae)
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 86e5d949bd1..1d030c9ce71 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1758,10 +1758,26 @@ tcp_config_fn (vlib_main_t * vm, unformat_input_t * input)
;
else if (unformat (input, "max-rx-fifo %U", unformat_memory_size,
&memory_size))
- tcp_cfg.max_rx_fifo = memory_size;
+ {
+ if (memory_size >= 0x100000000)
+ {
+ return clib_error_return
+ (0, "max-rx-fifo %llu (0x%llx) too large", memory_size,
+ memory_size);
+ }
+ tcp_cfg.max_rx_fifo = memory_size;
+ }
else if (unformat (input, "min-rx-fifo %U", unformat_memory_size,
&memory_size))
- tcp_cfg.min_rx_fifo = memory_size;
+ {
+ if (memory_size >= 0x100000000)
+ {
+ return clib_error_return
+ (0, "min-rx-fifo %llu (0x%llx) too large", memory_size,
+ memory_size);
+ }
+ tcp_cfg.min_rx_fifo = memory_size;
+ }
else if (unformat (input, "mtu %u", &tcp_cfg.default_mtu))
;
else if (unformat (input, "rwnd-min-update-ack %d",