Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2edacf80e155ef54ae4774379d461b60896bc2e
Commit:     c2edacf80e155ef54ae4774379d461b60896bc2e
Parent:     89c0d26be7037cd5bbce3bbf12580ba70ed8f382
Author:     Jay Vosburgh <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 10:42:47 2007 -0700
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 12:41:19 2007 -0400

    bonding / ipv6: no addrconf for slaves separately from master
    
        At present, when a device is enslaved to bonding, if ipv6 is
    active then addrconf will be initated on the slave (because it is closed
    then opened during the enslavement processing).  This causes DAD and RS
    packets to be sent from the slave.  These packets in turn can confuse
    switches that perform ipv6 snooping, causing them to incorrectly update
    their forwarding tables (if, e.g., the slave being added is an inactve
    backup that won't be used right away) and direct traffic away from the
    active slave to a backup slave (where the incoming packets will be
    dropped).
    
        This patch alters the behavior so that addrconf will only run on
    the master device itself.  I believe this is logically correct, as it
    prevents slaves from having an IPv6 identity independent from the
    master.  This is consistent with the IPv4 behavior for bonding.
    
        This is accomplished by (a) having bonding set IFF_SLAVE sooner
    in the enslavement processing than currently occurs (before open, not
    after), and (b) having ipv6 addrconf ignore UP and CHANGE events on
    slave devices.
    
        The eql driver also uses the IFF_SLAVE flag.  I inspected eql,
    and I believe this change is reasonable for its usage of IFF_SLAVE, but
    I did not test it.
    
    Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/bonding/bond_main.c |   11 +++++------
 net/ipv6/addrconf.c             |    3 +++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6287ffb..2bb70e0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1390,6 +1390,11 @@ int bond_enslave(struct net_device *bond_dev, struct 
net_device *slave_dev)
                goto err_free;
        }
 
+       res = netdev_set_master(slave_dev, bond_dev);
+       if (res) {
+               dprintk("Error %d calling netdev_set_master\n", res);
+               goto err_close;
+       }
        /* open the slave since the application closed it */
        res = dev_open(slave_dev);
        if (res) {
@@ -1397,12 +1402,6 @@ int bond_enslave(struct net_device *bond_dev, struct 
net_device *slave_dev)
                goto err_restore_mac;
        }
 
-       res = netdev_set_master(slave_dev, bond_dev);
-       if (res) {
-               dprintk("Error %d calling netdev_set_master\n", res);
-               goto err_close;
-       }
-
        new_slave->dev = slave_dev;
        slave_dev->priv_flags |= IFF_BONDING;
 
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index f96ed76..79b79f3 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2268,6 +2268,9 @@ static int addrconf_notify(struct notifier_block *this, 
unsigned long event,
                break;
        case NETDEV_UP:
        case NETDEV_CHANGE:
+               if (dev->flags & IFF_SLAVE)
+                       break;
+
                if (event == NETDEV_UP) {
                        if (!netif_carrier_ok(dev)) {
                                /* device is not ready yet. */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to