Skip to content

Commit

Permalink
bonding: Prevent IPv6 link local address on enslaved devices
Browse files Browse the repository at this point in the history
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 <kheiss@gmail.com>
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Reviewed-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Karl Heiss authored and David S. Miller committed Jan 11, 2016
1 parent 40ba330 commit 03d84a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,6 @@ static int bond_master_upper_dev_link(struct net_device *bond_dev,
err = netdev_master_upper_dev_link_private(slave_dev, bond_dev, slave);
if (err)
return err;
slave_dev->flags |= IFF_SLAVE;
rtmsg_ifinfo(RTM_NEWLINK, slave_dev, IFF_SLAVE, GFP_KERNEL);
return 0;
}
Expand Down Expand Up @@ -1465,6 +1464,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
}
}

/* set slave flag before open to prevent IPv6 addrconf */
slave_dev->flags |= IFF_SLAVE;

/* open the slave since the application closed it */
res = dev_open(slave_dev);
if (res) {
Expand Down Expand Up @@ -1725,6 +1727,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
dev_close(slave_dev);

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

0 comments on commit 03d84a5

Please sign in to comment.