This commit is contained in:
radius 2017-11-19 12:43:13 -05:00
parent e9afdb327e
commit c5dfa314ad

View File

@ -237,6 +237,11 @@ bool netplay_lan_ad_server(netplay_t *netplay)
char reply_addr[NETPLAY_HOST_STR_LEN], port_str[6]; char reply_addr[NETPLAY_HOST_STR_LEN], port_str[6];
struct addrinfo *our_addr, hints = {0}; struct addrinfo *our_addr, hints = {0};
net_ifinfo_t interfaces;
if (!net_ifinfo_new(&interfaces))
return false;
if (lan_ad_server_fd < 0 && !init_lan_ad_server_socket(netplay, RARCH_DEFAULT_PORT)) if (lan_ad_server_fd < 0 && !init_lan_ad_server_socket(netplay, RARCH_DEFAULT_PORT))
return false; return false;
@ -277,11 +282,6 @@ bool netplay_lan_ad_server(netplay_t *netplay)
strlcpy(reply_addr, ad_packet_buffer.address, NETPLAY_HOST_STR_LEN); strlcpy(reply_addr, ad_packet_buffer.address, NETPLAY_HOST_STR_LEN);
net_ifinfo_t interfaces;
if (!net_ifinfo_new(&interfaces))
return false;
for (k = 0; k < interfaces.size; k++) for (k = 0; k < interfaces.size; k++)
{ {
char *p; char *p;
@ -349,6 +349,7 @@ bool netplay_lan_ad_server(netplay_t *netplay)
} }
} }
net_ifinfo_free(&interfaces);
return true; return true;
} }