From ab19e19f00dcefc530d061cbeb6b149eae329362 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 11 Jan 2016 09:09:24 -0800 Subject: Fix a bug that we visually found in Windows code -- it was not advertising uPnP addresses?!? --- service/OneService.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'service') 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 mappedAddresses(_portMapper->get()); + for(std::vector::const_iterator ext(mappedAddresses.begin());ext!=mappedAddresses.end();++ext) + _node->addLocalInterfaceAddress(reinterpret_cast(&(*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(aabuf),&aalen) == NO_ERROR) { -- cgit v1.2.3