diff options
author | Hillf Danton <dhillf@gmail.com> | 2010-12-10 13:54:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-16 15:24:02 -0500 |
commit | af3e5bd5f650163c2e12297f572910a1af1b8236 (patch) | |
tree | 378ed230dc95ca29058c772aaf38aee44e583f63 | |
parent | 82cc4f5cb8be6dede34c32a814ab1470409e1840 (diff) |
bonding: Fix slave selection bug.
The returned slave is incorrect, if the net device under check is not
charged yet by the master.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bonding/bonding.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index c2f081352a03..4feeb2d650a4 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -269,11 +269,11 @@ static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct n | |||
269 | 269 | ||
270 | bond_for_each_slave(bond, slave, i) { | 270 | bond_for_each_slave(bond, slave, i) { |
271 | if (slave->dev == slave_dev) { | 271 | if (slave->dev == slave_dev) { |
272 | break; | 272 | return slave; |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | return slave; | 276 | return 0; |
277 | } | 277 | } |
278 | 278 | ||
279 | static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) | 279 | static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) |