diff --git a/include/upnp/upnp_control.h b/include/upnp/upnp_control.h index 69585392acf34fd82528021921f940def7cedb63..1a7d56a7d2d3100f1516877e55b8cb67ee940f48 100644 --- a/include/upnp/upnp_control.h +++ b/include/upnp/upnp_control.h @@ -54,6 +54,8 @@ public: void releaseMapping(const Mapping& map); static uint16_t generateRandomPort(PortType); + std::shared_ptr<UPnPContext> upnpContext() const { return upnpContext_; } + private: // Adds a mapping locally to the list. void addLocalMap(const Mapping& map); diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp index 47e730fc3c225ddec5a3a1b6787650aeff384ef3..f20d1fe66e53ccb4ed9e505644e13316458cd08e 100644 --- a/src/connectionmanager.cpp +++ b/src/connectionmanager.cpp @@ -1473,7 +1473,7 @@ ConnectionManager::Impl::getIceOptions() const noexcept IceTransportOptions opts; opts.factory = config_->factory; opts.upnpEnable = getUPnPActive(); - opts.upnpContext = config_->upnpCtrl; + opts.upnpContext = config_->upnpCtrl->upnpContext(); if (config_->stunEnabled) opts.stunServers.emplace_back(StunServerInfo().setUri(config_->stunServer));