[Bug 46940] GTA 5 clients cannot connect to each other behind home router

WineHQ Bugzilla wine-bugs at winehq.org
Thu Oct 3 18:09:10 CDT 2019


https://bugs.winehq.org/show_bug.cgi?id=46940

--- Comment #6 from Brendan Shanks <bshanks at codeweavers.com> ---
A full description of the problem:

GTA V (and probably other Rockstar games) gets the local hostname using
gethostname(), and then calls getaddrinfo() with the hostname to get the list
of local IP addresses. It takes that address and uses it as a source address
when listening for local network communications, it's also shown in-game as
"Local IP" in the Social Club overlay->Settings->Network.

The Windows documentation for getaddrinfo() supports this usage:
"If the pNodeName parameter points to a computer name, all permanent addresses
for the computer that can be used as a source address are returned. On Windows
Vista and later, these addresses would include all unicast IP addresses
returned by the GetUnicastIpAddressTable or GetUnicastIpAddressEntry functions
in which the SkipAsSource member is set to false in the
MIB_UNICASTIPADDRESS_ROW structure."

Wine's getaddrinfo() calls through to the host getaddrinfo(), which works very
similarly but does not document any guarantee like this.

Debian, Ubuntu, Arch, and likely other Linux distributions define the local
hostname to be '127.0.1.1' in /etc/hosts, apparently as a workaround for GNOME
(https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution).
When getaddrinfo() is called for the local hostname, '127.0.1.1' is the only
address returned. 

With the '127.0.1.1' line commented out in /etc/hosts, Linux getaddrinfo()
works as expected and returns all local IP addresses.

I haven't figured out any way to use Linux getaddrinfo() to return the local IP
addresses (without modifying /etc/hosts). I suspect the solution here is for
Wine's getaddrinfo() to detect when the local hostname is being supplied, and
use an alternate function to get the local IPs (like GetAdaptersAddresses or
GetUnicastIpAddressTable). It looks like this is how gethostbyname() works
already.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list