Skip to content

Commit 03d84a5

Browse files
kheissdavem330
authored andcommitted
bonding: Prevent IPv6 link local address on enslaved devices
Commit 1f718f0 ("bonding: populate neighbour's private on enslave") undoes the fix provided by commit c2edacf ("bonding / ipv6: no addrconf for slaves separately from master") by effectively setting the slave flag after the slave has been opened. If the slave comes up quickly enough, it will go through the IPv6 addrconf before the slave flag has been set and will get a link local IPv6 address. In order to ensure that addrconf knows to ignore the slave devices on state change, set IFF_SLAVE before dev_open() during bonding enslavement. Fixes: 1f718f0 ("bonding: populate neighbour's private on enslave") Signed-off-by: Karl Heiss <[email protected]> Signed-off-by: Jay Vosburgh <[email protected]> Reviewed-by: Jarod Wilson <[email protected]> Signed-off-by: Andy Gospodarek <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 40ba330 commit 03d84a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,6 @@ static int bond_master_upper_dev_link(struct net_device *bond_dev,
12071207
err = netdev_master_upper_dev_link_private(slave_dev, bond_dev, slave);
12081208
if (err)
12091209
return err;
1210-
slave_dev->flags |= IFF_SLAVE;
12111210
rtmsg_ifinfo(RTM_NEWLINK, slave_dev, IFF_SLAVE, GFP_KERNEL);
12121211
return 0;
12131212
}
@@ -1465,6 +1464,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
14651464
}
14661465
}
14671466

1467+
/* set slave flag before open to prevent IPv6 addrconf */
1468+
slave_dev->flags |= IFF_SLAVE;
1469+
14681470
/* open the slave since the application closed it */
14691471
res = dev_open(slave_dev);
14701472
if (res) {
@@ -1725,6 +1727,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
17251727
dev_close(slave_dev);
17261728

17271729
err_restore_mac:
1730+
slave_dev->flags &= ~IFF_SLAVE;
17281731
if (!bond->params.fail_over_mac ||
17291732
BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
17301733
/* XXX TODO - fom follow mode needs to change master's

0 commit comments

Comments
 (0)