From d4ff2b7bc7bbc07eec0c87c8adf4a8fb8367c57e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 1 Feb 2021 19:31:12 -0600 Subject: [PATCH] Don't create pinholes for temporary addresses --- GSv6Fwd/GSv6Fwd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GSv6Fwd/GSv6Fwd.cpp b/GSv6Fwd/GSv6Fwd.cpp index bcff4a6..5da4d1d 100644 --- a/GSv6Fwd/GSv6Fwd.cpp +++ b/GSv6Fwd/GSv6Fwd.cpp @@ -671,8 +671,8 @@ void UPnPCreatePinholesForInterface(struct UPNPUrls* urls, struct IGDdatas* data PSOCKADDR_IN6 currentAddrV6 = (PSOCKADDR_IN6)currentAddress->Address.lpSockaddr; - // Exclude link-local addresses - if (currentAddrV6->sin6_scope_id == 0) { + // Exclude link-local and privacy addresses + if (currentAddrV6->sin6_scope_id == 0 && currentAddress->SuffixOrigin != IpSuffixOriginRandom) { char currentAddrStr[128] = {}; inet_ntop(AF_INET6, ¤tAddrV6->sin6_addr, currentAddrStr, sizeof(currentAddrStr)); @@ -795,8 +795,8 @@ void UpdatePcpPinholes() PSOCKADDR_IN6 currentAddrV6 = (PSOCKADDR_IN6)currentAddress->Address.lpSockaddr; - // Exclude link-local addresses - if (currentAddrV6->sin6_scope_id == 0) { + // Exclude link-local and privacy addresses + if (currentAddrV6->sin6_scope_id == 0 && currentAddress->SuffixOrigin != IpSuffixOriginRandom) { inet_ntop(AF_INET6, ¤tAddrV6->sin6_addr, addressStr, sizeof(addressStr)); printf("Updating PCP mappings for address %s\n", addressStr);