Skip to content

Commit 92480b3

Browse files
qsndavem330
authored andcommitted
bonding: fix event handling for stacked bonds
When a bond is enslaved to another bond, bond_netdev_event() only handles the event as if the bond is a master, and skips treating the bond as a slave. This leads to a refcount leak on the slave, since we don't remove the adjacency to its master and the master holds a reference on the slave. Reproducer: ip link add bondL type bond ip link add bondU type bond ip link set bondL master bondU ip link del bondL No "Fixes:" tag, this code is older than git history. Signed-off-by: Sabrina Dubroca <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8ed633b commit 92480b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3213,8 +3213,12 @@ static int bond_netdev_event(struct notifier_block *this,
32133213
return NOTIFY_DONE;
32143214

32153215
if (event_dev->flags & IFF_MASTER) {
3216+
int ret;
3217+
32163218
netdev_dbg(event_dev, "IFF_MASTER\n");
3217-
return bond_master_netdev_event(event, event_dev);
3219+
ret = bond_master_netdev_event(event, event_dev);
3220+
if (ret != NOTIFY_DONE)
3221+
return ret;
32183222
}
32193223

32203224
if (event_dev->flags & IFF_SLAVE) {

0 commit comments

Comments
 (0)