summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorViacheslav <v.gletenko@vyos.io>2021-08-11 17:21:01 +0000
committerViacheslav <v.gletenko@vyos.io>2021-08-13 12:21:15 +0000
commitde88a17ba97200cdb3bd07ac3d12eab5d5fa6c73 (patch)
tree9628cc8d3b76cd8b6f19fade2fb8639b4e2654ea /src/conf_mode
parent82fbacd13f852374df2ecdd394b983325445f81b (diff)
downloadvyos-1x-de88a17ba97200cdb3bd07ac3d12eab5d5fa6c73.tar.gz
vyos-1x-de88a17ba97200cdb3bd07ac3d12eab5d5fa6c73.zip
isis: T3708: Fix errors in MTU calculation
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_isis.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/conf_mode/protocols_isis.py b/src/conf_mode/protocols_isis.py
index d4c82249b..4cf0312e9 100755
--- a/src/conf_mode/protocols_isis.py
+++ b/src/conf_mode/protocols_isis.py
@@ -113,9 +113,13 @@ def verify(isis):
# Interface MTU must be >= configured lsp-mtu
mtu = Interface(interface).get_mtu()
area_mtu = isis['lsp_mtu']
- if mtu < int(area_mtu):
- raise ConfigError(f'Interface {interface} has MTU {mtu}, minimum ' \
- f'area MTU is {area_mtu}!')
+ # Recommended maximum PDU size = interface MTU - 3 bytes
+ recom_area_mtu = mtu - 3
+ if mtu < int(area_mtu) or int(area_mtu) > recom_area_mtu:
+ raise ConfigError(f'Interface {interface} has MTU {mtu}, ' \
+ f'current area MTU is {area_mtu}! \n' \
+ f'Recommended area lsp-mtu {recom_area_mtu} or less ' \
+ '(calculated on MTU size).')
if 'vrf' in isis:
# If interface specific options are set, we must ensure that the