Page MenuHomeVyOS Platform

bond: missing validation of member interface MTU
Closed, ResolvedPublicBUG

Description

Running VyOS on PROXMOX using virtio NICs.

set interfaces bonding bond0 member interface eth2
set interfaces bonding bond0 mtu 9000
commit
Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/interfaces_bonding.py", line 300, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces_bonding.py", line 273, in apply
    b.update(bond)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/bond.py", line 506, in update
    super().update(config)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1702, in update
    self.set_mtu(config.get('mtu'))
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 457, in set_mtu
    return self.set_interface('mtu', mtu)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 183, in set_interface
    return self._set_command(self.config, name, value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 110, in _set_command
    return self._command_set[name].get('format', lambda _: _)(self._cmd(cmd))
                                                              ^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 52, in _cmd
    return cmd(command, self.debug)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/process.py", line 155, in cmd
    raise OSError(code, feedback)
FileNotFoundError: [Errno 2] failed to run command: ip link set dev bond0 mtu 9000
returned:
exit code: 2

noteworthy:
cmd 'ip link set dev bond0 mtu 9000'
returned (out):

returned (err):
RTNETLINK answers: Invalid argument

[[interfaces bonding bond0]] failed
Commit failed

Linux Kernel reports:

[   82.543104] bond0: (slave eth2): Enslaving as a backup interface with an up link
[   82.596964] eth2: mtu greater than device maximum
[   82.778655] bond0: (slave eth2): Releasing backup interface
[   82.784346] 8021q: adding VLAN 0 to HW filter on device eth2
[   82.808107] 8021q: adding VLAN 0 to HW filter on device eth2
[   82.808150] bond0: (slave eth2): Enslaving as a backup interface with an up link
[   82.851745] eth2: mtu greater than device maximum

Details

Version
1.4.3
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)