From f95d36edba00ec276ec03573a7fdaa6070babd3d Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sat, 9 May 2020 12:16:46 +0200 Subject: use AF_UNSPEC if AI_V4MAPPED is not available Else we can't listen IPv4 only on these systems. --- hittpd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hittpd.c b/hittpd.c index 0d33211..f067442 100644 --- a/hittpd.c +++ b/hittpd.c @@ -901,11 +901,13 @@ main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); struct addrinfo hints = { - .ai_family = AF_INET6, .ai_socktype = SOCK_STREAM, - .ai_flags = AI_PASSIVE #ifdef AI_V4MAPPED - | AI_V4MAPPED + .ai_family = AF_INET6, + .ai_flags = AI_PASSIVE | AI_V4MAPPED +#else + .ai_family = AF_UNSPEC, + .ai_flags = AI_PASSIVE, #endif }, *res; -- cgit 1.4.1