[libc-commits] [libc] [libc] Add `IN6_IS_ADDR_{LINK, SITE}LOCAL` (PR #168207)

Connector Switch via libc-commits libc-commits at lists.llvm.org
Wed Dec 10 09:09:04 PST 2025


================
@@ -33,4 +33,12 @@
 #define INET_ADDRSTRLEN 16
 #define INET6_ADDRSTRLEN 46
 
+#define IN6_IS_ADDR_LINKLOCAL(a)                                               \
+  ((__LLVM_LIBC_CAST(reinterpret_cast, uint8_t *, a)[0]) == 0xfe &&            \
+   (__LLVM_LIBC_CAST(reinterpret_cast, uint8_t *, a)[1] & 0xc0) == 0x80)
----------------
c8ef wrote:

Done.

https://github.com/llvm/llvm-project/pull/168207


More information about the libc-commits mailing list