Message ID | 20091030083452.68ca227e@nehalam |
---|---|
State | Rejected, archived |
Delegated to: | David Miller |
Headers | show |
From: Stephen Hemminger <shemminger@linux-foundation.org> Date: Fri, 30 Oct 2009 08:34:52 -0700 > Why not fix the problem in a generic way? Drivers still need to make sure carrier is off when their ->open() routine runs, so that the transition event from link down to link up occurs properly when the device is brought up. So mucking around with this carrier test will only hide the bugs, not make things easier. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/net/core/ethtool.c 2009-10-30 08:32:52.584728610 -0700 +++ b/net/core/ethtool.c 2009-10-30 08:33:31.806667877 -0700 @@ -27,7 +27,7 @@ u32 ethtool_op_get_link(struct net_device *dev) { - return netif_carrier_ok(dev) ? 1 : 0; + return netif_running(dev) && netif_carrier_ok(dev); } u32 ethtool_op_get_rx_csum(struct net_device *dev)
Why not fix the problem in a generic way? --- Subject: ethtool: link is only up if device is running Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html