Merge pull request #21360 from yuwata/network-json

network: json: add more information
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-11-26 11:04:52 +01:00
committed by GitHub
11 changed files with 1064 additions and 48 deletions
+7
View File
@@ -114,6 +114,13 @@ static inline size_t FAMILY_ADDRESS_SIZE(int family) {
return family == AF_INET6 ? 16 : 4;
}
#define FAMILY_ADDRESS_SIZE_SAFE(f) \
({ \
int _f = (f); \
_f == AF_INET ? sizeof(struct in_addr) : \
_f == AF_INET6 ? sizeof(struct in6_addr) : 0; \
})
/* Workaround for clang, explicitly specify the maximum-size element here.
* See also oss-fuzz#11344. */
#define IN_ADDR_NULL ((union in_addr_union) { .in6 = {} })