From 3d8bab088e763130a27a17199fce18de4e3a50b2 Mon Sep 17 00:00:00 2001 From: Ofer Heifetz Date: Thu, 14 Apr 2022 19:21:19 +0300 Subject: tls: do not overwrite config parameters if set User can define first_seg_size and add-segment-size in the tls configuration section, but current code does not take this configuration into account and sets a default value to first_seg_size and add_seg_size respectively. This commit checks if configuration was set and only if not uses the default values. Type: fix Signed-off-by: Ofer Heifetz Change-Id: I0077f7d54fe7773dd92522476f882c924fda22df --- src/vnet/tls/tls.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c index 9cf10086a91..6482d5d8047 100644 --- a/src/vnet/tls/tls.c +++ b/src/vnet/tls/tls.c @@ -1315,8 +1315,11 @@ tls_init (vlib_main_t * vm) vec_validate (tm->rx_bufs, num_threads - 1); vec_validate (tm->tx_bufs, num_threads - 1); - tm->first_seg_size = 32 << 20; - tm->add_seg_size = 256 << 20; + if (!tm->first_seg_size) + tm->first_seg_size = 32 << 20; + + if (!tm->add_seg_size) + tm->add_seg_size = 256 << 20; transport_register_protocol (TRANSPORT_PROTO_TLS, &tls_proto, FIB_PROTOCOL_IP4, ~0); -- cgit 1.2.3-korg