summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-07-27 11:53:07 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-07-28 10:00:17 +0000
commit319102b7f9ea384127b685de7cfbef2a6ade52df (patch)
treed3a61eb5ef4546c5896e268bf37b5980bb693d4a
parent8bbaafd554d003078607121e2de662c9c8edee40 (diff)
downloadvyos-1x-319102b7f9ea384127b685de7cfbef2a6ade52df.tar.gz
vyos-1x-319102b7f9ea384127b685de7cfbef2a6ade52df.zip
vxlan: T4570: Verify MTU for remote address if source not defined
In some cases `source_address` can be not defined in the conf So we should to check list of `remote` vxlanX addresses If remote address is IPv6 - add overhead +20 bytes to default overhead 50. I.e. +70 bytes for IPv6
-rwxr-xr-xsrc/conf_mode/interfaces-vxlan.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-vxlan.py b/src/conf_mode/interfaces-vxlan.py
index bf0f6840d..af2d0588d 100755
--- a/src/conf_mode/interfaces-vxlan.py
+++ b/src/conf_mode/interfaces-vxlan.py
@@ -118,6 +118,11 @@ def verify(vxlan):
# in use.
vxlan_overhead += 20
+ # If source_address is not used - check IPv6 'remote' list
+ elif 'remote' in vxlan:
+ if any(is_ipv6(a) for a in vxlan['remote']):
+ vxlan_overhead += 20
+
lower_mtu = Interface(vxlan['source_interface']).get_mtu()
if lower_mtu < (int(vxlan['mtu']) + vxlan_overhead):
raise ConfigError(f'Underlaying device MTU is to small ({lower_mtu} '\