diff options
author | Christian Breunig <christian@breunig.cc> | 2023-08-23 20:21:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-23 20:21:12 +0200 |
commit | bf7e94a6606c9245721194b7d5c18c24a9f8baef (patch) | |
tree | 06f56c3f2aeef4f6c8bae2f04d53bef2a7a71e2e /src/conf_mode/system-ip.py | |
parent | db67bc204e77fb2dd7d4a76672c63bc9bbfc07e1 (diff) | |
parent | 6e1333d1e71651e9822ef74d989b928df313ea6e (diff) | |
download | vyos-1x-bf7e94a6606c9245721194b7d5c18c24a9f8baef.tar.gz vyos-1x-bf7e94a6606c9245721194b7d5c18c24a9f8baef.zip |
Merge pull request #2139 from dmbaturin/T5449-mss-probing
system-ip: T5449: add TCP MSS probing options
Diffstat (limited to 'src/conf_mode/system-ip.py')
-rwxr-xr-x | src/conf_mode/system-ip.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/conf_mode/system-ip.py b/src/conf_mode/system-ip.py index 63dff0e36..9ed34c735 100755 --- a/src/conf_mode/system-ip.py +++ b/src/conf_mode/system-ip.py @@ -95,6 +95,27 @@ def apply(opt): value = '1' if (tmp != None) else '0' sysctl_write('net.ipv4.fib_multipath_hash_policy', value) + # configure TCP options (defaults as of Linux 6.4) + tmp = dict_search('tcp.mss.probing', opt) + if tmp is None: + value = 0 + elif tmp == 'on-icmp-black-hole': + value = 1 + elif tmp == 'force': + value = 2 + else: + # Shouldn't happen + raise ValueError("TCP MSS probing is neither 'on-icmp-black-hole' nor 'force'!") + sysctl_write('net.ipv4.tcp_mtu_probing', value) + + tmp = dict_search('tcp.mss.base', opt) + value = '1024' if (tmp is None) else tmp + sysctl_write('net.ipv4.tcp_base_mss', value) + + tmp = dict_search('tcp.mss.floor', opt) + value = '48' if (tmp is None) else tmp + sysctl_write('net.ipv4.tcp_mtu_probe_floor', value) + if 'protocol' in opt: zebra_daemon = 'zebra' # Save original configuration prior to starting any commit actions |