From f1dcd96e42990d5d506cd9215f246353fd4b1d63 Mon Sep 17 00:00:00 2001 From: Andrea Bondavalli Date: Wed, 25 Nov 2020 12:46:51 +0100 Subject: [PATCH] Fix for incorrect SAP packets TTL This fixes issue #25 --- daemon/sap.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daemon/sap.cpp b/daemon/sap.cpp index 51d9ccb..804940d 100644 --- a/daemon/sap.cpp +++ b/daemon/sap.cpp @@ -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; }