From 54231254be998a49a002483826810f8299c69dda Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Thu, 20 Feb 2025 00:59:55 +0000 Subject: [PATCH] Process requests targetting broadcast address --- src/udp_collector.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/udp_collector.cpp b/src/udp_collector.cpp index 8e0366e7a..b43436dd6 100644 --- a/src/udp_collector.cpp +++ b/src/udp_collector.cpp @@ -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); + } + } } }