From 0361b1ca8fb88bf6ec409fe833d9cc5d730258c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20=C5=A0imerda?= Date: Wed, 17 Apr 2013 12:27:00 +0200 Subject: [PATCH] trivial: ETHTOOL_GLINK usage explanation --- src/platform/nm-linux-platform.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index bb1b3608f3..f409a7abb6 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -851,7 +851,14 @@ link_supports_carrier_detect (NMPlatform *platform, int ifindex) const char *name = nm_platform_link_get_name (ifindex); struct ethtool_cmd edata = { .cmd = ETHTOOL_GLINK }; - /* We ignore the result and only return FALSE on error */ + /* We ignore the result. If the ETHTOOL_GLINK call succeeded, then we + * assume the device supports carrier-detect, otherwise we assume it + * doesn't. + * + * We don't use ETHTOOL_GLINK for carrier detect itself, so this can + * be regarded as a hack. Instead, kernel should be able to report + * carrier detection capability via netlink. + */ return name && ethtool_get (name, &edata); }