Skip to content

libnm-core: allow empty slave-type with a NMSettingBondPort

Beniamino Galvani requested to merge bg/bond-port-verify into main

It is allowed to have a connection with empty connection.slave-type and a NMSettingBondPort; the property will be set automatically during normalization if a master is set, otherwise the setting will be removed.

With this change, it becomes possible to remove a port from a bond from nmcli, turning it into a non-slave connection. Before, this used to fail with:

  $ nmcli connection add type ethernet ifname test con-name test+ connection.master bond0 connection.slave-type bond
  $ nmcli connection modify test+ connection.master '' connection.slave-type ''
  Error: Failed to modify connection 'test+': connection.slave-type: A connection with a 'bond-port' setting must have the slave-type set to 'bond'

https://bugzilla.redhat.com/show_bug.cgi?id=2126262

Fixes: 9958510f ('bond: add support of queue_id of bond port')

Merge request reports