diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-11-06 14:12:30 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-11-09 08:20:51 +0900 |
commit | de0f1579847a69f51db4e00062eafc37df7456fe (patch) | |
tree | 6fd24d241e1c3a0ecf2776b3319aa009e4c22a45 /src/basic/ether-addr-util.h | |
parent | 1f86a3fe52c71af7f46381bf45c2efe580a19dcc (diff) | |
download | systemd-de0f1579847a69f51db4e00062eafc37df7456fe.tar.gz |
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
---
Diffstat (limited to 'src/basic/ether-addr-util.h')
-rw-r--r-- | src/basic/ether-addr-util.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/ether-addr-util.h b/src/basic/ether-addr-util.h index a7f42ccd1a..c5cfdb4233 100644 --- a/src/basic/ether-addr-util.h +++ b/src/basic/ether-addr-util.h @@ -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; |