net: Add IN6_IS_ADDR_LINKLOCAL macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-09-18 02:58:55 +08:00 committed by archer
parent 6903f02d41
commit 53466c6d46
1 changed files with 3 additions and 0 deletions

View File

@ -193,6 +193,9 @@
#define IN6_IS_ADDR_MULTICAST(a) \
((a)->s6_addr[0] == 0xff)
#define IN6_IS_ADDR_LINKLOCAL(a) \
((a)->s6_addr16[0] & HTONS(0xffc0) == HTONS(0xfe80))
#define IN6_IS_ADDR_LOOPBACK(a) \
((a)->s6_addr32[0] == 0 && \
(a)->s6_addr32[1] == 0 && \