Skip to content

Commit c4c5c5d

Browse files
NikAleksandrovPaolo Abeni
authored andcommitted
bonding: fix xfrm state handling when clearing active slave
If the active slave is cleared manually the xfrm state is not flushed. This leads to xfrm add/del imbalance and adding the same state multiple times. For example when the device cannot handle anymore states we get: [ 1169.884811] bond0: (slave eni0np1): bond_ipsec_add_sa_all: failed to add SA because it's filled with the same state after multiple active slave clearings. This change also has a few nice side effects: user-space gets a notification for the change, the old device gets its mac address and promisc/mcast adjusted properly. Fixes: 18cb261 ("bonding: support hardware encryption offload to slaves") Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent f8cde98 commit c4c5c5d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/bonding/bond_options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
936936
/* check to see if we are clearing active */
937937
if (!slave_dev) {
938938
netdev_dbg(bond->dev, "Clearing current active slave\n");
939-
RCU_INIT_POINTER(bond->curr_active_slave, NULL);
939+
bond_change_active_slave(bond, NULL);
940940
bond_select_active_slave(bond);
941941
} else {
942942
struct slave *old_active = rtnl_dereference(bond->curr_active_slave);

0 commit comments

Comments
 (0)