Fix for incorrect SAP packets TTL

This fixes issue #25
This commit is contained in:
Andrea Bondavalli 2020-11-25 12:46:51 +01:00
parent 3fa3be6aaa
commit f1dcd96e42

View File

@ -51,6 +51,14 @@ bool SAP::set_multicast_interface(const std::string& interface_ip) {
BOOST_LOG_TRIVIAL(error) << "sap::enable_loopback option " << ec.message();
return false;
}
/* https://tools.ietf.org/html/rfc2974 ttl = 255 */
boost::asio::ip::multicast::hops ttl_option(255);
socket_.set_option(ttl_option, ec);
if (ec) {
BOOST_LOG_TRIVIAL(error) << "sap::hops/ttl option " << ec.message();
return false;
}
return true;
}