bonding: make speed, duplex setting consistent with link state
authorMahesh Bandewar <maheshb@google.com>
Mon, 27 Mar 2017 18:37:35 +0000 (11:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Mar 2018 08:17:44 +0000 (09:17 +0100)
commit851eb3187617dcaacf6162626dd750850d5abef1
tree7a59df99e008b81009928e0cc89e30bacac84046
parent3a8649e6c5b28b4bb72ce94a9b1967ffdd70481d
bonding: make speed, duplex setting consistent with link state

[ Upstream commit c4adfc822bf5d8e97660b6114b5a8892530ce8cb ]

bond_update_speed_duplex() retrieves speed and duplex settings. There
is a possibility of failure in retrieving these values but caller has
to assume it's always successful. This leads to having inconsistent
slave link settings. If these (speed, duplex) values cannot be
retrieved, then keeping the link UP causes problems.

The updated bond_update_speed_duplex() returns 0 on success if it
retrieves sane values for speed and duplex. On failure it returns 1
and marks the link down.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/bonding/bond_main.c