From f929f18c5952e033be0f75d28b90c57e1877e434 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 10 Jun 2021 00:29:59 +0900 Subject: network: use hw_addr_equal() or friends --- src/network/networkctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/network/networkctl.c') diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 4423847eaf..aeb3ee5c09 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -554,11 +554,11 @@ 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 && - memcmp(&info->hw_address, &HW_ADDR_NULL, sizeof(struct hw_addr_data)) != 0; + !hw_addr_is_null(&info->hw_address); info->has_permanent_mac_address = ethtool_get_permanent_macaddr(NULL, info->name, &info->permanent_mac_address) >= 0 && - memcmp(&info->permanent_mac_address, ÐER_ADDR_NULL, sizeof(struct ether_addr)) != 0 && + !ether_addr_is_null(&info->permanent_mac_address) && (info->hw_address.length != sizeof(struct ether_addr) || memcmp(&info->permanent_mac_address, info->hw_address.bytes, sizeof(struct ether_addr)) != 0); -- cgit v1.2.1