From: Yu Watanabe Date: Thu, 4 Nov 2021 17:31:36 +0000 (+0900) Subject: networkctl: read permanent hardware address from netlink message X-Git-Tag: v250-rc1~260^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49c351a8aca5b683974fcb258c3335e821617c3d;p=thirdparty%2Fsystemd.git networkctl: read permanent hardware address from netlink message --- diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 14319007aa4..2d0866a81d5 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -557,7 +557,8 @@ static int decode_link(sd_netlink_message *m, LinkInfo *info, char **patterns, b info->hw_address.length > 0; info->has_permanent_hw_address = - ethtool_get_permanent_hw_addr(NULL, info->name, &info->permanent_hw_address) >= 0 && + (netlink_message_read_hw_addr(m, IFLA_PERM_ADDRESS, &info->permanent_hw_address) >= 0 || + ethtool_get_permanent_hw_addr(NULL, info->name, &info->permanent_hw_address) >= 0) && !hw_addr_is_null(&info->permanent_hw_address) && !hw_addr_equal(&info->permanent_hw_address, &info->hw_address);