godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.33k stars 21.06k forks source link

NetBSD DNS resolution for type IP_ANY always return IPV6 (AI_ADDRCONFIG not working). #42166

Open ghost opened 4 years ago

ghost commented 4 years ago

Godot version: Godot 3.2.x git

OS/device including version: NetBSD 9 AMD64

Issue description: I am given an error about trying to connect to the asset server. I don't know if this is a NetBSD issue or a godot issue.

Steps to reproduce: Compile the 3.2.x git on NetBSD and watch the output in xterm. It loads fine, but gives an error about not being able to connect to the asset server.

ERROR: connect_to_host: Connection to remote host failed! At: core/io/stream_peer_tcp.cpp:94.

akien-mga commented 4 years ago

I've seen the same issue while porting the 3.2 branch to NetBSD.

I was running in VirtualBox and my networking setup was a bit hacked together as it doesn't seem to work out of the box on a fresh NetBSD 9.0 install to share the host connection:

I haven't tried further but it's possible that the problem is not with the Asset Library but just with Godot on NetBSD not being able to do a TLS connection.

akien-mga commented 4 years ago

I've checked and confirmed that it doesn't seem related to the Asset Library, but the networking stack which doesn't seem to work currently in NetBSD.

See this test project: Test Network.zip (It's the second example from https://docs.godotengine.org/en/stable/classes/class_httprequest.html)

On NetBSD HTTPRequest fails to connect to the host, both with https:// and http://.

I get (with -v flag):

Loading builtin certs
Loading resource: res://HTTPRequest.tscn
Loading resource: res://HTTPRequest.gd
Socket error: 65
Connection to remote host failed!
ERROR: connect_to_host: Connection to remote host failed!
   At: core/io/stream_peer_tcp.cpp:94

(In the 3.2 branch, c8859f0463835266e6e9736d71891f81137673d1)

Faless commented 4 years ago

DNS resolution is broken in NetBSD (connectivity itself works otherwise).

It seems that the flag AI_ADDRCONFIG of getaddrinfo is not implemented: http://gnats.netbsd.org/44777 , (very old, but I can't see any implementation in the latest(?) source either: http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/lib/libc/net/getaddrinfo.c?rev=1.117.4.1 )