only start natpmp on listen sockets that have a router (since NATPMP needs one)

This commit is contained in:
arvidn 2020-01-11 20:04:21 +01:00 committed by Arvid Norberg
parent 88d9c05e3c
commit a1d78aa60e
1 changed files with 1 additions and 1 deletions

View File

@ -5470,7 +5470,7 @@ namespace aux {
if (is_v6(s.local_endpoint) && is_local(s.local_endpoint.address()))
return;
if (!s.natpmp_mapper)
if (!s.natpmp_mapper && (s.flags & listen_socket_t::has_gateway))
{
// the natpmp constructor may fail and call the callbacks
// into the session_impl.