diff options
Diffstat (limited to 'Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp')
-rw-r--r-- | Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp b/Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp index 6e4d0eb..9b83173 100644 --- a/Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp +++ b/Swiften/Network/UPnPNATTraversalRemovePortForwardingRequest.cpp @@ -36,7 +36,7 @@ void UPnPNATTraversalRemovePortForwardingRequest::runBlocking() { std::string publicPort = str(boost::format("%d") % mapping.publicPort); std::string localPort = str(boost::format("%d") % mapping.localPort); - std::string internalClient = getLocalClient().toString(); + std::string internalClient = PlatformNetworkEnvironment().getLocalAddress().toString(); std::string leaseSeconds = str(boost::format("%d") % mapping.leaseInSeconds); UPNPUrls urls; IGDdatas data; @@ -74,19 +74,4 @@ void UPnPNATTraversalRemovePortForwardingRequest::runBlocking() { onResult(result); } -HostAddress UPnPNATTraversalRemovePortForwardingRequest::getLocalClient() { - PlatformNetworkEnvironment env; - - foreach (NetworkInterface::ref iface, env.getNetworkInterfaces()) { - if (!iface->isLoopback()) { - foreach (HostAddress address, iface->getAddresses()) { - if (address.getRawAddress().is_v4()) { - return address; - } - } - } - } - return HostAddress(); -} - } |