From 863baeb68b4b75d08c33f865dd5821789a7e8316 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 16 Aug 2018 11:02:53 -0400 Subject: [PATCH] ignore unpublished addresses --- daemon/UPnP.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/UPnP.cpp b/daemon/UPnP.cpp index ba7b408c..3aad19c6 100644 --- a/daemon/UPnP.cpp +++ b/daemon/UPnP.cpp @@ -131,8 +131,8 @@ namespace transport const auto& a = context.GetRouterInfo().GetAddresses(); for (const auto& address : a) { - if (!address->host.is_v6 ()) - TryPortMapping (address); + if (!address->host.is_v6 () && address->port) + TryPortMapping (address); } m_Timer.expires_from_now (boost::posix_time::minutes(20)); // every 20 minutes m_Timer.async_wait ([this](const boost::system::error_code& ecode) @@ -148,7 +148,7 @@ namespace transport const auto& a = context.GetRouterInfo().GetAddresses(); for (const auto& address : a) { - if (!address->host.is_v6 ()) + if (!address->host.is_v6 () && address->port) CloseMapping (address); } }