]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ether-addr-util: fix ether_addr_is_local() and add one more helper
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 12 Nov 2021 10:55:43 +0000 (19:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 12 Nov 2021 11:00:29 +0000 (20:00 +0900)
Follow-up for 1f86a3fe52c71af7f46381bf45c2efe580a19dcc.

src/basic/ether-addr-util.h

index bee1fc9c7a0285c4ee2c2624ffdf7eaf57ae2be1..32f45fe8135ea6236c4b678d19ca8cb4f2161801 100644 (file)
@@ -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;