提交 2430af8b 编写于 作者: J Jiri Bohac 提交者: David S. Miller

bonding: 802.3ad - fix agg_device_up

The slave member of struct aggregator does not necessarily point
to a slave which is part of the aggregator. It points to the
slave structure containing the aggregator structure, while
completely different slaves (or no slaves at all) may be part of
the aggregator.

The agg_device_up() function wrongly uses agg->slave to find the state
of the aggregator.  Use agg->lag_ports->slave instead. The bug has
been introduced by commit 4cd6fe1c
("bonding: fix link down handling in 802.3ad mode").
Signed-off-by: NJiri Bohac <jbohac@suse.cz>
Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6f4d6dc1
...@@ -1482,8 +1482,11 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, ...@@ -1482,8 +1482,11 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
static int agg_device_up(const struct aggregator *agg) static int agg_device_up(const struct aggregator *agg)
{ {
return (netif_running(agg->slave->dev) && struct port *port = agg->lag_ports;
netif_carrier_ok(agg->slave->dev)); if (!port)
return 0;
return (netif_running(port->slave->dev) &&
netif_carrier_ok(port->slave->dev));
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册