This fixes the following error:
---
systemd-networkd[
1449490]: ip6tnl0: Saved hardware address: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
systemd-networkd[
1449490]: ip6tnl0: Failed to manage link by its new hardware address, ignoring: File exists
---
return hw_addr_compare(a, b) == 0;
}
static inline bool hw_addr_is_null(const struct hw_addr_data *addr) {
- return hw_addr_equal(addr, &HW_ADDR_NULL);
+ assert(addr);
+ return addr->length == 0 || memeqzero(addr->bytes, addr->length);
}
extern const struct hash_ops hw_addr_hash_ops;
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 &&
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",