Skip to content

Commit

Permalink
Add a proper scope when scanning IPv6 addresses on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fgo-ableton committed Feb 1, 2024
1 parent f7292ed commit ece9bff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/ableton/platforms/windows/ScanIpIfAddrs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ struct ScanIpIfAddrs
{
SOCKADDR_IN6* sockAddr =
reinterpret_cast<SOCKADDR_IN6*>(address->Address.lpSockaddr);
const auto scopeId = sockAddr->sin6_scope_id;
const auto bytes = reinterpret_cast<const char*>(&sockAddr->sin6_addr);
const auto addr6 = discovery::makeAddress<discovery::IpAddressV6>(bytes);
const auto addr6 =
discovery::makeAddress<discovery::IpAddressV6>(bytes, scopeId);
if (!addr6.is_loopback() && addr6.is_link_local())
{
addrs.emplace_back(addr6);
Expand Down

0 comments on commit ece9bff

Please sign in to comment.