mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
addons: address: disable reseting of mtu based on default mtu
Ticket: CM-10471 Reviewed By: Testing Done: Tested with failing config in CM-10471 Recent commit "84f33af6e1f53d ("address.py: default value for mtu when mtu attribute is removed") CM-9449" enabled setting of device mtu to default mtu if mtu is not given in the interfaces file. logical devices like bridges and vlan devices rely on mtu from their lower devices. ie mtu travels from lower devices to upper devices. For bonds mtu travels from upper to lower devices. running mtu depends on upper and lower device mtu. With all this implicit mtu config by the kernel in play, it becomes almost impossible to compare running mtu with the default mtu. This commit disables this resetting of mtu based on default mtu. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
@ -263,10 +263,20 @@ class address(moduleBase):
|
||||
mtu = ifaceobj.get_attr_value_first('mtu')
|
||||
if mtu:
|
||||
self.ipcmd.link_set(ifaceobj.name, 'mtu', mtu)
|
||||
elif self.default_mtu:
|
||||
running_mtu = self.ipcmd.link_get_mtu(ifaceobj.name)
|
||||
if running_mtu != self.default_mtu:
|
||||
self.ipcmd.link_set(ifaceobj.name, 'mtu', self.default_mtu)
|
||||
|
||||
# logical devices like bridges and vlan devices rely on mtu
|
||||
# from their lower devices. ie mtu travels from
|
||||
# lower devices to upper devices. For bonds mtu travels from
|
||||
# upper to lower devices. running mtu depends on upper and
|
||||
# lower device mtu. With all this implicit mtu
|
||||
# config by the kernel in play, it becomes almost impossible
|
||||
# to decide if the running mtu is valid. It will require
|
||||
# some more thinking. Commenting this for now.
|
||||
#elif self.default_mtu:
|
||||
# running_mtu = self.ipcmd.link_get_mtu(ifaceobj.name)
|
||||
# if running_mtu != self.default_mtu:
|
||||
# self.ipcmd.link_set(ifaceobj.name, 'mtu', self.default_mtu)
|
||||
|
||||
alias = ifaceobj.get_attr_value_first('alias')
|
||||
if alias:
|
||||
self.ipcmd.link_set_alias(ifaceobj.name, alias)
|
||||
|
Reference in New Issue
Block a user