pull/1010/head
AlexandreRouma 2023-03-08 19:39:15 +01:00
rodzic 4283cacae6
commit 9cc793e328
2 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -289,6 +289,7 @@ namespace net {
// Save data
for (auto iface = addresses; iface; iface = iface->ifa_next) {
if (iface->ifa_addr->sa_family != AF_INET) { continue; }
if (!iface->ifa_addr || !iface->ifa_netmask) { continue; }
InterfaceInfo info;
info.address = ntohl(*(uint32_t*)&iface->ifa_addr->sa_data[2]);
info.netmask = ntohl(*(uint32_t*)&iface->ifa_netmask->sa_data[2]);

Wyświetl plik

@ -205,6 +205,7 @@ namespace hermes {
}
std::vector<Info> discover() {
// TODO: Maybe try to instead detect on each interface as a work around for 0.0.0.0 not receiving anything?
auto sock = net::openudp("0.0.0.0", 1024);
// Build discovery packet