mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 07:40:08 +01:00
trivial: ETHTOOL_GLINK usage explanation
This commit is contained in:
parent
b6d2ae429f
commit
0361b1ca8f
1 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue