From c342c103aed089345182bdeee2633520e594272b Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 23:08:26 -0500 Subject: [PATCH] Always get numeric host/ports instead of names. --- libretro-common/net/net_natt.c | 2 +- network/netplay/netplay.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 5bb6b380ee..6c37fa225d 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -100,7 +100,7 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t return false; /* figure out the internal info */ - if (getnameinfo(addr, addrlen, host, PATH_MAX_LENGTH, port_str, 6, 0) != 0) + if (getnameinfo(addr, addrlen, host, PATH_MAX_LENGTH, port_str, 6, NI_NUMERICHOST|NI_NUMERICSERV) != 0) return false; proto_str = (proto == SOCKET_PROTOCOL_UDP) ? "UDP" : "TCP"; diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index b2d33088f3..5bf7bdaf58 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -1076,7 +1076,7 @@ static void announce_nat_traversal(netplay_t *netplay) { if (getnameinfo((const struct sockaddr *) &netplay->nat_traversal_state.ext_inet4_addr, sizeof(struct sockaddr_in), - host, PATH_MAX_LENGTH, port, 6, 0) != 0) + host, PATH_MAX_LENGTH, port, 6, NI_NUMERICHOST|NI_NUMERICSERV) != 0) return; } @@ -1085,7 +1085,7 @@ static void announce_nat_traversal(netplay_t *netplay) { if (getnameinfo((const struct sockaddr *) &netplay->nat_traversal_state.ext_inet6_addr, sizeof(struct sockaddr_in6), - host, PATH_MAX_LENGTH, port, 6, 0) != 0) + host, PATH_MAX_LENGTH, port, 6, NI_NUMERICHOST|NI_NUMERICSERV) != 0) return; }