From 319102b7f9ea384127b685de7cfbef2a6ade52df Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 27 Jul 2022 11:53:07 +0000 Subject: 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 --- src/conf_mode/interfaces-vxlan.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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} '\ -- cgit v1.2.3