summary refs log tree commit diff stats
path: root/lib/pure/rawsockets.nim
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2015-06-24 02:08:17 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2015-06-24 02:08:17 +0200
commit41be1c6c4dfe99989d746175dbb1904152302e8e (patch)
tree0430f2366a078c5c8f68c1a715ae15a37c0f087e /lib/pure/rawsockets.nim
parent21ee21cc2374bef7de57932f2eadcd82667022cf (diff)
downloadNim-41be1c6c4dfe99989d746175dbb1904152302e8e.tar.gz
Allow to connect to IPv4-mapped addresses for IPv6 sockets - thus full IPv4 compatibility.
Diffstat (limited to 'lib/pure/rawsockets.nim')
-rw-r--r--lib/pure/rawsockets.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/pure/rawsockets.nim b/lib/pure/rawsockets.nim
index c97718b0a..9bfe9dab5 100644
--- a/lib/pure/rawsockets.nim
+++ b/lib/pure/rawsockets.nim
@@ -195,6 +195,7 @@ proc getAddrInfo*(address: string, port: Port, af: Domain = AF_INET, typ: SockTy
   hints.ai_family = toInt(af)
   hints.ai_socktype = toInt(typ)
   hints.ai_protocol = toInt(prot)
+  hints.ai_flags = posix.AI_V4MAPPED
   var gaiResult = getaddrinfo(address, $port, addr(hints), result)
   if gaiResult != 0'i32:
     when useWinVersion: