Skip to content

Commit

Permalink
netinet/in.h: add IN6_IS_ADDR_GLOBAL macro
Browse files Browse the repository at this point in the history
Signed-off-by: meijian <meijian@xiaomi.com>
  • Loading branch information
Meissi-jian authored and xiaoxiang781216 committed Nov 20, 2024
1 parent 5ff98f6 commit d86d902
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/netinet/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@
(a)->s6_addr32[2] == 0 && \
(a)->s6_addr32[3] == 0)

#define IN6_IS_ADDR_GLOBAL(a) \
(!IN6_IS_ADDR_MULTICAST(a) && \
!IN6_IS_ADDR_LINKLOCAL(a) && \
!IN6_IS_ADDR_LOOPBACK(a) && \
!IN6_IS_ADDR_UNSPECIFIED(a))

#define IN6_IS_ADDR_V4COMPAT(a) \
((a)->s6_addr32[0] == 0 && \
(a)->s6_addr32[1] == 0 && \
Expand Down

0 comments on commit d86d902

Please sign in to comment.