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:45:14 +0200 |
commit | 5b11ad0024552f9072c8bc046bb8ce7ad5a193b2 (patch) | |
tree | 6b3a5a500a551a892e32f2d4f848dd0301c41218 | |
parent | 8ab73ce0f84e10ae3c4f6bdb341b7b6b11db66b4 (diff) | |
download | vyos-1x-5b11ad0024552f9072c8bc046bb8ce7ad5a193b2.tar.gz vyos-1x-5b11ad0024552f9072c8bc046bb8ce7ad5a193b2.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.
(cherry picked from commit 601ab19fd8c81a998b3c966cc83b85ed60ac5ae0)
-rw-r--r-- | 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 e8278b103..214c8dcb1 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1362,6 +1362,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(): # IPv6 forwarding @@ -1402,10 +1409,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') |