fix: enable multicast loop

This commit is contained in:
Yat Ho 2024-03-27 16:02:17 +08:00
parent 3fe87979a1
commit 83d2dc991d
1 changed files with 18 additions and 0 deletions

View File

@ -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<char const*>(&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<char const*>(&opt_on),
sizeof(opt_on)) == -1)
{
return false;
}
}
}