mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-12-25 02:18:30 +01:00
bugfix
This commit is contained in:
parent
4283cacae6
commit
9cc793e328
@ -289,6 +289,7 @@ namespace net {
|
|||||||
// Save data
|
// Save data
|
||||||
for (auto iface = addresses; iface; iface = iface->ifa_next) {
|
for (auto iface = addresses; iface; iface = iface->ifa_next) {
|
||||||
if (iface->ifa_addr->sa_family != AF_INET) { continue; }
|
if (iface->ifa_addr->sa_family != AF_INET) { continue; }
|
||||||
|
if (!iface->ifa_addr || !iface->ifa_netmask) { continue; }
|
||||||
InterfaceInfo info;
|
InterfaceInfo info;
|
||||||
info.address = ntohl(*(uint32_t*)&iface->ifa_addr->sa_data[2]);
|
info.address = ntohl(*(uint32_t*)&iface->ifa_addr->sa_data[2]);
|
||||||
info.netmask = ntohl(*(uint32_t*)&iface->ifa_netmask->sa_data[2]);
|
info.netmask = ntohl(*(uint32_t*)&iface->ifa_netmask->sa_data[2]);
|
||||||
|
@ -205,6 +205,7 @@ namespace hermes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Info> discover() {
|
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);
|
auto sock = net::openudp("0.0.0.0", 1024);
|
||||||
|
|
||||||
// Build discovery packet
|
// Build discovery packet
|
||||||
|
Loading…
Reference in New Issue
Block a user