From 83d2dc991dfd0a87d6d6e9885aa1d25df134c6f2 Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Wed, 27 Mar 2024 16:02:17 +0800 Subject: [PATCH] fix: enable multicast loop --- libtransmission/tr-lpd.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libtransmission/tr-lpd.cc b/libtransmission/tr-lpd.cc index 95705e1fc..97c66a6a3 100644 --- a/libtransmission/tr-lpd.cc +++ b/libtransmission/tr-lpd.cc @@ -394,6 +394,13 @@ private: { return false; } + + // needed to announce to BT clients on the same interface + if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_LOOP, reinterpret_cast(&opt_on), sizeof(opt_on)) == + -1) + { + return false; + } } else // TR_AF_INET6 { @@ -434,6 +441,17 @@ private: { return false; } + + // needed to announce to BT clients on the same interface + if (setsockopt( + sock, + IPPROTO_IPV6, + IPV6_MULTICAST_LOOP, + reinterpret_cast(&opt_on), + sizeof(opt_on)) == -1) + { + return false; + } } }