diff --git a/src/client.cpp b/src/client.cpp index c2acb87..52e9426 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -475,7 +475,7 @@ ContextImpl::ContextImpl(const Config& conf, const evbase& tcp_loop) searchBuckets.resize(nBuckets); std::set bcasts; - for(auto& addr : searchTx.interfaces()) { + for(auto& addr : searchTx.broadcasts()) { addr.setPort(0u); bcasts.insert(addr); } diff --git a/src/config.cpp b/src/config.cpp index 2b79621..3b37247 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -165,7 +165,7 @@ void expandAddrList(const std::vector& ifaces, continue; } - for(auto& addr : dummy.interfaces(&saddr)) { + for(auto& addr : dummy.broadcasts(&saddr)) { addr.setPort(0u); bcasts.push_back(addr.tostring()); } diff --git a/src/describe.cpp b/src/describe.cpp index 6c5499f..2fe713a 100644 --- a/src/describe.cpp +++ b/src/describe.cpp @@ -107,7 +107,7 @@ std::ostream& target_information(std::ostream& strm) strm<\n"; Indented J(strm); - for(auto& addr : dummy.interfaces()) { + for(auto& addr : dummy.broadcasts()) { strm< evsocket::interfaces(const SockAddr* match) +std::vector evsocket::broadcasts(const SockAddr* match) { if(match && match->family()!=AF_INET) { throw std::logic_error("osiSockDiscoverBroadcastAddresses() only understands AF_INET"); diff --git a/src/evhelper.h b/src/evhelper.h index 3ba095f..cbb711a 100644 --- a/src/evhelper.h +++ b/src/evhelper.h @@ -227,7 +227,7 @@ struct PVXS_API evsocket void mcast_iface(const SockAddr& iface) const; //! wraps osiSockDiscoverBroadcastAddresses() - std::vector interfaces(const SockAddr* match=nullptr); + std::vector broadcasts(const SockAddr* match=nullptr); }; } // namespace impl diff --git a/src/server.cpp b/src/server.cpp index d5b429e..c13573d 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -405,7 +405,7 @@ Server::Pvt::Pvt(const Config &conf) * is to bind a second socket to the interface broadcast address, * which will then receive only broadcasts. */ - for(auto bcast : dummy.interfaces(&addr)) { + for(auto bcast : dummy.broadcasts(&addr)) { bcast.setPort(addr.port()); listeners.push_back(manager.onSearch(bcast, std::bind(&Pvt::onSearch, this, std::placeholders::_1) )); @@ -457,7 +457,7 @@ Server::Pvt::Pvt(const Config &conf) // i[1] host // mix together first interface and all local bcast addresses pun.i[1] ^= ntohl(osiLocalAddr(dummy.sock).ia.sin_addr.s_addr); - for(auto& addr : dummy.interfaces()) { + for(auto& addr : dummy.broadcasts()) { if(addr.family()==AF_INET) pun.i[1] ^= ntohl(addr->in.sin_addr.s_addr); }