diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-11-12 19:55:43 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-11-12 20:00:29 +0900 |
commit | 847f1ea69edc73c6a9235ff45b005691ce1d33c5 (patch) | |
tree | 0a56b1bd6ba61a173052187e9590058a42117c86 | |
parent | 6ebbcafeb433958e4552ebf49cacf10a9426d929 (diff) | |
download | systemd-847f1ea69edc73c6a9235ff45b005691ce1d33c5.tar.gz |
ether-addr-util: fix ether_addr_is_local() and add one more helper
Follow-up for 1f86a3fe52c71af7f46381bf45c2efe580a19dcc.
-rw-r--r-- | src/basic/ether-addr-util.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/basic/ether-addr-util.h b/src/basic/ether-addr-util.h index bee1fc9c7a..32f45fe813 100644 --- a/src/basic/ether-addr-util.h +++ b/src/basic/ether-addr-util.h @@ -102,7 +102,11 @@ static inline bool ether_addr_is_unicast(const struct ether_addr *addr) { static inline bool ether_addr_is_local(const struct ether_addr *addr) { /* Determine if the Ethernet address is locally-assigned one (IEEE 802) */ assert(addr); - return !FLAGS_SET(addr->ether_addr_octet[0], 0x02); + return FLAGS_SET(addr->ether_addr_octet[0], 0x02); +} + +static inline bool ether_addr_is_global(const struct ether_addr *addr) { + return !ether_addr_is_local(addr); } extern const struct hash_ops ether_addr_hash_ops; |