When the mode of a bond is changed, and the bond is restarted after that, the new mode is not correctly set for the bond. Error message: /lib/rc/net/bonding.sh: line 48: echo: write error: Operation not permitted The reason is, that the bond is taken down totally, when stopped. Reproducible: Always Steps to Reproduce: 1. Configure a bond in /etc/conf.d/net: config_bond0="192.168.127.1/32" mode_bond0="active-passive" miimon_bond0="100" slaves_bond0="eth2" 2. Start the bond and check mode # /etc/init.d/net.bond0 start # cat /sys/class/net/bond0/bonding/mode active-backup 1 3. Stop the bond: # /etc/init.d/net.bond0 stop 4. Change mode in /etc/conf.d/net: mode_bond0="active-rr" 5. Start the bond and check mode # /etc/init.d/net.bond0 start # cat /sys/class/net/bond0/bonding/mode active-backup 1 Actual Results: When the bond is started again, the mode is not changed and stays with the configuration of the first start. Expected Results: The mode of bond should be configured to the settings in /etc/conf.d/net.
Created attachment 242525 [details, diff] Take bond completly down, when stopped. When using the sysfs interface for bonding, the best practice should be to set 'options bonding max_bonds=0' in /etc/modprobe.d/bond.conf. This patch then takes a bond down and destroys it, when sysfs is used.
Looks good, we'll include it. Thanks again for the patch.
(In reply to comment #2) > Looks good, we'll include it. Thanks again for the patch. > Closing as it is already commited in our overlay, please check next release which will happen later this week to ensure problem is resolved, as always if it is not please reopen the bug.