diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-03-31 21:38:17 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-03-31 21:38:17 +0200 |
commit | 601ab19fd8c81a998b3c966cc83b85ed60ac5ae0 (patch) | |
tree | 7ffa48a31e6ca0037363b1ca4b395ceeff337743 /python/vyos/ifconfig | |
parent | 53e20097d227ebf4bdb4dc6c85427ec9c5ec3982 (diff) | |
download | vyos-1x-601ab19fd8c81a998b3c966cc83b85ed60ac5ae0.tar.gz vyos-1x-601ab19fd8c81a998b3c966cc83b85ed60ac5ae0.zip |
vyos.ifconfig: T4330: MTU must be configured prior to any IPv6 option change
This extends the fix from 53e20097 ("vyos.ifconfig: T4330: bugfix changing MTU
when IPv6 is disabled") by ordering the execution in a way the Kernel does not
complain.
Diffstat (limited to 'python/vyos/ifconfig')
-rwxr-xr-x | python/vyos/ifconfig/interface.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index f39da90e4..d6906a061 100755 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1501,6 +1501,13 @@ class Interface(Control): value = tmp if (tmp != None) else '0' self.set_ipv4_source_validation(value) + # MTU - Maximum Transfer Unit has a default value. It must ALWAYS be set + # before mangling any IPv6 option. If MTU is less then 1280 IPv6 will be + # automatically disabled by the kernel. Also MTU must be increased before + # configuring any IPv6 address on the interface. + if 'mtu' in config: + self.set_mtu(config.get('mtu')) + # Only change IPv6 parameters if IPv6 was not explicitly disabled if is_ipv6_enabled(): # Configure MSS value for IPv6 TCP connections @@ -1546,10 +1553,6 @@ class Interface(Control): for addr in tmp: self.add_ipv6_eui64_address(addr) - # MTU - Maximum Transfer Unit - if 'mtu' in config: - self.set_mtu(config.get('mtu')) - # re-add ourselves to any bridge we might have fallen out of if 'is_bridge_member' in config: bridge_dict = config.get('is_bridge_member') |