Skip to content

Commit 986ddc8

Browse files
zhhyu7xiaoxiang781216
authored andcommitted
netinet/in.h: add macro definitions to resolve compilation errors
solve the compiling problem of the third-party library, add IN6_IS_ADDR_MC_LINKLOCAL and IN6_IS_ADDR_SITELOCAL definitions. Signed-off-by: zhanghongyu <[email protected]>
1 parent e21885b commit 986ddc8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/netinet/in.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@
225225
(a)->s6_addr32[1] == 0 && \
226226
(a)->s6_addr32[2] == HTONL(0xffff))
227227

228+
#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
229+
(IN6_IS_ADDR_MULTICAST(a) && ((a)->s6_addr[1] & 0xf) == 0x2)
230+
231+
#define IN6_IS_ADDR_SITELOCAL(a) \
232+
(((a)->s6_addr16[0] & HTONS(0xffc0)) == HTONS(0xfec0))
233+
228234
/* This macro to convert a 16/32-bit constant values quantity from host byte
229235
* order to network byte order. The 16-bit version of this macro is required
230236
* for uIP:

0 commit comments

Comments
 (0)