mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-24 11:45:16 +00:00
commit
4c3969976b
@ -237,6 +237,11 @@ bool netplay_lan_ad_server(netplay_t *netplay)
|
||||
char reply_addr[NETPLAY_HOST_STR_LEN], port_str[6];
|
||||
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))
|
||||
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);
|
||||
|
||||
net_ifinfo_t interfaces;
|
||||
|
||||
if (!net_ifinfo_new(&interfaces))
|
||||
return false;
|
||||
|
||||
for (k = 0; k < interfaces.size; k++)
|
||||
{
|
||||
char *p;
|
||||
@ -339,6 +339,8 @@ bool netplay_lan_ad_server(netplay_t *netplay)
|
||||
/* And send it */
|
||||
sendto(lan_ad_server_fd, (const char*)&ad_packet_buffer,
|
||||
sizeof(struct ad_packet), 0, our_addr->ai_addr, our_addr->ai_addrlen);
|
||||
if (our_addr)
|
||||
freeaddrinfo_retro(our_addr);
|
||||
}
|
||||
else
|
||||
continue;
|
||||
@ -347,8 +349,9 @@ bool netplay_lan_ad_server(netplay_t *netplay)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
net_ifinfo_free(&interfaces);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user