#include <string.h>
#include <unistd.h>
+#ifdef __NetBSD__
+# define gethostbyaddr(addr, len, type) \
+ gethostbyaddr((const char *)(addr), len, type)
+#endif
+
static void dns_main(void) _noreturn_; /* the child process runs this */
#define CHILD 0 /* child process uses this socket */
type = "site-local";
else if (IN6_IS_ADDR_MULTICAST(&reply.addr.ip.v6))
type = "multicast";
- } else { /* AF_INET */
- if (IN_MULTICAST(reply.addr.ip.v4))
+ } else {
+ assert(reply.addr.family == IPv4);
+ if (IN_MULTICAST(htonl(reply.addr.ip.v4)))
type = "multicast";
}
xasprintf(name, "(%s)", type);