Re: [PATCH net-next] bonding: roll back fail_over_mac if enslave fails

From: Daniel Machon

Date: Mon Nov 30 2026 - 06:28:17 EST


> From: Hangbin Liu <liuhangbin@xxxxxxxxxx>
>
> bond_enslave() can change bond->params.fail_over_mac as a side
> effect: when the first slave cannot set its own MAC address and the
> bond is in active-backup mode, fail_over_mac is forced to "active" so
> bonding never writes the slave MAC. If enslave fails later, the
> forced value stays behind, silently changing a user-configured
> option after a failed operation and affecting subsequent failover
> behaviour.
>
> Snapshot fail_over_mac on entry and restore it on the error path.
>
> Signed-off-by: Hangbin Liu <liuhangbin@xxxxxxxxxx>

Reviewed-by: Daniel Machon <daniel.machon@xxxxxxxxxxxxx>