mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-21 10:11:18 +00:00
Merge pull request #11739 from SimpleTease/ipv6
netplay: attempt ipv4 when ipv6 failure
This commit is contained in:
commit
08b9c40728
@ -134,6 +134,7 @@ static bool init_tcp_socket(netplay_t *netplay, void *direct_host,
|
|||||||
if (getaddrinfo_retro(server, port_buf, &hints, &res) != 0)
|
if (getaddrinfo_retro(server, port_buf, &hints, &res) != 0)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_INET6
|
#ifdef HAVE_INET6
|
||||||
|
try_wildcard:
|
||||||
if (!server)
|
if (!server)
|
||||||
{
|
{
|
||||||
/* Didn't work with IPv6, try wildcard */
|
/* Didn't work with IPv6, try wildcard */
|
||||||
@ -213,7 +214,13 @@ static bool init_tcp_socket(netplay_t *netplay, void *direct_host,
|
|||||||
freeaddrinfo_retro(res);
|
freeaddrinfo_retro(res);
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_INET6
|
||||||
|
if (!direct_host && (hints.ai_family == AF_INET6))
|
||||||
|
goto try_wildcard;
|
||||||
|
#endif
|
||||||
RARCH_ERR("Failed to set up netplay sockets.\n");
|
RARCH_ERR("Failed to set up netplay sockets.\n");
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user