summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorJuan Francisco Cantero Hurtado <iam@juanfra.info>2015-11-23 04:27:20 +0100
committerJuan Francisco Cantero Hurtado <iam@juanfra.info>2015-11-23 04:27:20 +0100
commite0835948bddacf3fb5eb23f228ffe3d014a09d93 (patch)
tree3eeeee23050c15aae175fa147e4e7280824022c2 /lib/pure
parent3c5a0b1b1a16f386e96370f634f28f9fb7b9f062 (diff)
downloadNim-e0835948bddacf3fb5eb23f228ffe3d014a09d93.tar.gz
OpenBSD doesn't support AI_V4MAPPED
Related to #3534
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/nativesockets.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/nativesockets.nim b/lib/pure/nativesockets.nim
index c9e067a3e..9e6ff21ef 100644
--- a/lib/pure/nativesockets.nim
+++ b/lib/pure/nativesockets.nim
@@ -203,8 +203,10 @@ proc getAddrInfo*(address: string, port: Port, domain: Domain = AF_INET,
   hints.ai_family = toInt(domain)
   hints.ai_socktype = toInt(sockType)
   hints.ai_protocol = toInt(protocol)
+  # OpenBSD doesn't support AI_V4MAPPED and doesn't define the macro AI_V4MAPPED.
+  # FreeBSD doesn't support AI_V4MAPPED but defines the macro.
   # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198092
-  when not defined(freebsd):
+  when not defined(freebsd) or defined(openbsd):
     hints.ai_flags = AI_V4MAPPED
   var gaiResult = getaddrinfo(address, $port, addr(hints), result)
   if gaiResult != 0'i32: