Merge pull request #21271 from yuwata/ether-addr-util-helper-functions
ether-addr-util: introduce several helper functions
This commit is contained in:
@@ -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 &&
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user