summaryrefslogtreecommitdiff
path: root/service/OneService.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-01-11 09:09:24 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-01-11 09:09:24 -0800
commitab19e19f00dcefc530d061cbeb6b149eae329362 (patch)
tree7adac573277e1ee492dfe944c20769c9a76f777e /service/OneService.cpp
parent1023ef23b7bf6a65fb563f7ba33ed7a20b139e5e (diff)
downloadinfinitytier-ab19e19f00dcefc530d061cbeb6b149eae329362.tar.gz
infinitytier-ab19e19f00dcefc530d061cbeb6b149eae329362.zip
Fix a bug that we visually found in Windows code -- it was not advertising uPnP addresses?!?
Diffstat (limited to 'service/OneService.cpp')
-rw-r--r--service/OneService.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/service/OneService.cpp b/service/OneService.cpp
index 6e4ba904..f17d2194 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -811,6 +811,14 @@ public:
ztDevices.push_back(t->second->luid());
}
+ _node->clearLocalInterfaceAddresses();
+
+#ifdef ZT_USE_MINIUPNPC
+ std::vector<InetAddress> mappedAddresses(_portMapper->get());
+ for(std::vector<InetAddress>::const_iterator ext(mappedAddresses.begin());ext!=mappedAddresses.end();++ext)
+ _node->addLocalInterfaceAddress(reinterpret_cast<const struct sockaddr_storage *>(&(*ext)));
+#endif
+
char aabuf[16384];
ULONG aalen = sizeof(aabuf);
if (GetAdaptersAddresses(AF_UNSPEC,GAA_FLAG_SKIP_ANYCAST|GAA_FLAG_SKIP_MULTICAST|GAA_FLAG_SKIP_DNS_SERVER,(void *)0,reinterpret_cast<PIP_ADAPTER_ADDRESSES>(aabuf),&aalen) == NO_ERROR) {