]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkctl: read permanent hardware address from netlink message
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 4 Nov 2021 17:31:36 +0000 (02:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 12 Nov 2021 23:53:33 +0000 (08:53 +0900)
src/network/networkctl.c

index 14319007aa4dac33ba2b957e55d5169f9ca3c78f..2d0866a81d5d1a3eed78d8f8ded40a33328a6085 100644 (file)
@@ -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);