Commit 4d1412f0 authored by Dominik Charousset's avatar Dominik Charousset

Enable IPv4 mapping rather then exluding OpenBSD

Listing each OS that hasn't AI_V4MAPPED defined is both verbose and
brittle. Simply checking whether AI_V4MAPPED exists before attempting to
use it always works, regardless of the OS.
parent 54fe2541
......@@ -290,7 +290,7 @@ bool interfaces::get_endpoint(const std::string& host, uint16_t port,
hint.ai_socktype = SOCK_DGRAM;
if (preferred)
hint.ai_family = *preferred == protocol::network::ipv4 ? AF_INET : AF_INET6;
#ifndef __OpenBSD__
#ifdef AI_V4MAPPED
if (hint.ai_family == AF_INET6)
hint.ai_flags = AI_V4MAPPED;
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment