diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-10 00:29:59 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-10 00:29:59 +0900 |
commit | f929f18c5952e033be0f75d28b90c57e1877e434 (patch) | |
tree | f2e6625252a3240fc2840b7f61fe00fcbd5a2961 /src/network/networkctl.c | |
parent | 30b977251ce76eaaae8e4a21836516b47fd7ed84 (diff) | |
download | systemd-f929f18c5952e033be0f75d28b90c57e1877e434.tar.gz |
network: use hw_addr_equal() or friends
Diffstat (limited to 'src/network/networkctl.c')
-rw-r--r-- | src/network/networkctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |