diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-05-09 12:16:46 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-05-09 12:16:46 +0200 |
commit | f95d36edba00ec276ec03573a7fdaa6070babd3d (patch) | |
tree | 716fcb2f3fbe1c6f19cdc069b5775112d6109433 | |
parent | 88bc37b955d2a46e55c3ea870fd76846f8fe5fbc (diff) | |
download | hittpd-f95d36edba00ec276ec03573a7fdaa6070babd3d.tar.gz hittpd-f95d36edba00ec276ec03573a7fdaa6070babd3d.tar.xz hittpd-f95d36edba00ec276ec03573a7fdaa6070babd3d.zip |
use AF_UNSPEC if AI_V4MAPPED is not available
Else we can't listen IPv4 only on these systems.
-rw-r--r-- | hittpd.c | 8 |
1 files 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; |