Merge pull request #3393 from nanoant/patch/fix-freebsd-getaddrinfo

rawsockets: Fix getaddrinfo on FreeBSD
This commit is contained in:
Dominik Picheta 2015-10-03 14:50:50 +01:00
commit a35ba105f7

View file

@ -201,6 +201,8 @@ proc getAddrInfo*(address: string, port: Port, domain: Domain = AF_INET,
hints.ai_family = toInt(domain) hints.ai_family = toInt(domain)
hints.ai_socktype = toInt(sockType) hints.ai_socktype = toInt(sockType)
hints.ai_protocol = toInt(protocol) hints.ai_protocol = toInt(protocol)
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198092
when not defined(freebsd):
hints.ai_flags = AI_V4MAPPED hints.ai_flags = AI_V4MAPPED
var gaiResult = getaddrinfo(address, $port, addr(hints), result) var gaiResult = getaddrinfo(address, $port, addr(hints), result)
if gaiResult != 0'i32: if gaiResult != 0'i32: