From 986ddc83ce0fb98d0903a783492dbe86826cd251 Mon Sep 17 00:00:00 2001 From: zhanghongyu Date: Wed, 7 Aug 2024 21:05:15 +0800 Subject: [PATCH] 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 --- include/netinet/in.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/netinet/in.h b/include/netinet/in.h index 6901e44e2d..564fa7b390 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -225,6 +225,12 @@ (a)->s6_addr32[1] == 0 && \ (a)->s6_addr32[2] == HTONL(0xffff)) +#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && ((a)->s6_addr[1] & 0xf) == 0x2) + +#define IN6_IS_ADDR_SITELOCAL(a) \ + (((a)->s6_addr16[0] & HTONS(0xffc0)) == HTONS(0xfec0)) + /* This macro to convert a 16/32-bit constant values quantity from host byte * order to network byte order. The 16-bit version of this macro is required * for uIP: