Merge pull request #21271 from yuwata/ether-addr-util-helper-functions

ether-addr-util: introduce several helper functions
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-11-09 10:02:55 +01:00
committed by GitHub
3 changed files with 26 additions and 3 deletions
+1 -1
View File
@@ -554,7 +554,7 @@ static int decode_link(sd_netlink_message *m, LinkInfo *info, char **patterns, b
info->has_mac_address =
netlink_message_read_hw_addr(m, IFLA_ADDRESS, &info->hw_address) >= 0 &&
!hw_addr_is_null(&info->hw_address);
info->hw_address.length > 0;
info->has_permanent_mac_address =
ethtool_get_permanent_macaddr(NULL, info->name, &info->permanent_mac_address) >= 0 &&
+1 -1
View File
@@ -2036,7 +2036,7 @@ static int link_update_hardware_address(Link *link, sd_netlink_message *message)
if (hw_addr_equal(&link->hw_addr, &addr))
return 0;
if (hw_addr_is_null(&link->hw_addr))
if (link->hw_addr.length == 0)
log_link_debug(link, "Saved hardware address: %s", HW_ADDR_TO_STR(&addr));
else {
log_link_debug(link, "Hardware address is changed: %s → %s",