Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103449
b: refs/heads/master
c: 7e1a1ac
h: refs/heads/master
i:
  103447: 8fb7cc2
v: v3
  • Loading branch information
Wang Chen authored and David S. Miller committed Jul 15, 2008
1 parent 94cc1e6 commit 7a733ac
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2aeb0b88b3c7a0e3bef55e7ff0efffd5d971aa57
refs/heads/master: 7e1a1ac1fbaa88fe254400b7f30b775502932ad3
6 changes: 4 additions & 2 deletions trunk/drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,10 @@ static void rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[])
}

if (!bond->alb_info.primary_is_promisc) {
bond->alb_info.primary_is_promisc = 1;
dev_set_promiscuity(bond->curr_active_slave->dev, 1);
if (!dev_set_promiscuity(bond->curr_active_slave->dev, 1))
bond->alb_info.primary_is_promisc = 1;
else
bond->alb_info.primary_is_promisc = 0;
}

bond->alb_info.rlb_promisc_timeout_counter = 0;
Expand Down
39 changes: 31 additions & 8 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,39 +772,49 @@ static struct dev_mc_list *bond_mc_list_find_dmi(struct dev_mc_list *dmi, struct
/*
* Push the promiscuity flag down to appropriate slaves
*/
static void bond_set_promiscuity(struct bonding *bond, int inc)
static int bond_set_promiscuity(struct bonding *bond, int inc)
{
int err = 0;
if (USES_PRIMARY(bond->params.mode)) {
/* write lock already acquired */
if (bond->curr_active_slave) {
dev_set_promiscuity(bond->curr_active_slave->dev, inc);
err = dev_set_promiscuity(bond->curr_active_slave->dev,
inc);
}
} else {
struct slave *slave;
int i;
bond_for_each_slave(bond, slave, i) {
dev_set_promiscuity(slave->dev, inc);
err = dev_set_promiscuity(slave->dev, inc);
if (err)
return err;
}
}
return err;
}

/*
* Push the allmulti flag down to all slaves
*/
static void bond_set_allmulti(struct bonding *bond, int inc)
static int bond_set_allmulti(struct bonding *bond, int inc)
{
int err = 0;
if (USES_PRIMARY(bond->params.mode)) {
/* write lock already acquired */
if (bond->curr_active_slave) {
dev_set_allmulti(bond->curr_active_slave->dev, inc);
err = dev_set_allmulti(bond->curr_active_slave->dev,
inc);
}
} else {
struct slave *slave;
int i;
bond_for_each_slave(bond, slave, i) {
dev_set_allmulti(slave->dev, inc);
err = dev_set_allmulti(slave->dev, inc);
if (err)
return err;
}
}
return err;
}

/*
Expand Down Expand Up @@ -965,6 +975,7 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct
}

if (new_active) {
/* FIXME: Signal errors upstream. */
if (bond->dev->flags & IFF_PROMISC) {
dev_set_promiscuity(new_active->dev, 1);
}
Expand Down Expand Up @@ -1544,12 +1555,16 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (!USES_PRIMARY(bond->params.mode)) {
/* set promiscuity level to new slave */
if (bond_dev->flags & IFF_PROMISC) {
dev_set_promiscuity(slave_dev, 1);
res = dev_set_promiscuity(slave_dev, 1);
if (res)
goto err_close;
}

/* set allmulti level to new slave */
if (bond_dev->flags & IFF_ALLMULTI) {
dev_set_allmulti(slave_dev, 1);
res = dev_set_allmulti(slave_dev, 1);
if (res)
goto err_close;
}

netif_tx_lock_bh(bond_dev);
Expand Down Expand Up @@ -4065,6 +4080,10 @@ static void bond_set_multicast_list(struct net_device *bond_dev)
* Do promisc before checking multicast_mode
*/
if ((bond_dev->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC)) {
/*
* FIXME: Need to handle the error when one of the multi-slaves
* encounters error.
*/
bond_set_promiscuity(bond, 1);
}

Expand All @@ -4074,6 +4093,10 @@ static void bond_set_multicast_list(struct net_device *bond_dev)

/* set allmulti flag to slaves */
if ((bond_dev->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI)) {
/*
* FIXME: Need to handle the error when one of the multi-slaves
* encounters error.
*/
bond_set_allmulti(bond, 1);
}

Expand Down

0 comments on commit 7a733ac

Please sign in to comment.