ether-addr-util: make hw_addr_is_null() return true also for all zero address

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
---
This commit is contained in:
Yu Watanabe
2021-11-09 08:20:51 +09:00
parent 1f86a3fe52
commit de0f157984
3 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -37,7 +37,8 @@ static inline bool hw_addr_equal(const struct hw_addr_data *a, const struct hw_a
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;