Musl libc requires the length parameter of getnameinfo() to be exactly
`sizeof(struct sockaddr_in)` or `sizeof(struct sockaddr_in6)`, depending on
the passed sockaddr family.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
nixio__addr_write(&addr, (struct sockaddr *)&saddr);
- int res = getnameinfo((struct sockaddr *)&saddr, sizeof(saddr),
+ int res = getnameinfo((struct sockaddr *)&saddr,
+ (saddr.ss_family == AF_INET)
+ ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6),
host, sizeof(host), NULL, 0, NI_NAMEREQD);
#ifdef __linux__