1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00

networkctl: read permanent hardware address from netlink message

This commit is contained in:
Yu Watanabe 2021-11-05 02:31:36 +09:00
parent 8a77e245df
commit 49c351a8ac

View 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);