| From | Paul Gortmaker <> | Subject | [34-longterm 146/209] bonding: Fix slave selection bug. | Date | Thu, 14 Apr 2011 13:55:04 -0400 |
| |
From: Hillf Danton <dhillf@gmail.com>
===================================================================== | This is a commit scheduled for the next v2.6.34 longterm release. | | If you see a problem with using this for longterm, please comment.| =====================================================================
commit af3e5bd5f650163c2e12297f572910a1af1b8236 upstream
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> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- 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 257a7a4..d881eb8 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -235,11 +235,11 @@ static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct n bond_for_each_slave(bond, slave, i) { if (slave->dev == slave_dev) { - break; + return slave; } } - return slave; + return 0; } static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) -- 1.7.4.4
|