Skip to content

bond: avoid setting "active_slave" option without interface enslaved

Thomas Haller requested to merge th/bond-active-slave-warning into master

Kernel will reject setting "active_slave", if the interface is not enslaved or not up. We already handle that by setting the option whenever we enslave an interface. However, we also must not set it initially, otherwise we get an ugly error log message:

    NetworkManager[939]: <debug> [1594709143.7459] platform-linux: sysctl: setting net:/sys/class/net/bond99/bonding/active_slave to eth1 (current value is )
    NetworkManager[939]: <error> [1594709143.7459] platform-linux: sysctl: failed to set bonding/active_slave to eth1: (22) Invalid argument
    NetworkManager[939]: <warn>  [1594709143.7460] device (bond99): failed to set bonding attribute active_slave to eth1
    ...
    kernel: bond99: (slave eth1): Device is not bonding slave
    kernel: bond99: option active_slave: invalid value (eth1)

See-also: https://bugzilla.redhat.com/show_bug.cgi?id=1856640

Merge request reports