Skip to content

Commit

Permalink
Process requests targetting broadcast address
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddieAkeroyd committed Feb 20, 2025
1 parent f2e49a8 commit 5423125
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/udp_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ void UDPCollector::process_one(const SockAddr &dest, const uint8_t *buf, size_t
for(auto L : listeners) {
if(L->searchCB && (L->dest.addr.isAny() || L->dest.addr==dest)) {
(L->searchCB)(*this);
} else if(L->searchCB && !(L->dest.addr.isAny())) {
for(auto B : sock.broadcasts(&(L->dest.addr))) {
if(!(B.compare(dest, false)) && (L->dest.addr.port() == dest.port())) {
log_debug_printf(logio, "Processing broadcast %s on %s\n",
dest.tostring().c_str(), L->dest.addr.tostring().c_str());
(L->searchCB)(*this);
}
}
}
}

Expand Down

0 comments on commit 5423125

Please sign in to comment.