undeprecate the upnp_ignore_nonrouters setting with a slightly different meaning. still default to false and make it mean to ignore routers outside of the local subnet

This commit is contained in:
arvidn 2020-04-30 13:07:43 +02:00 committed by Arvid Norberg
parent 79191c3be3
commit 5a251a1684
4 changed files with 6 additions and 8 deletions

View File

@ -1,3 +1,4 @@
* undeprecate upnp_ignore_nonrouters (but refering to devices on our subnet)
* increase default tracker timeout * increase default tracker timeout
* retry failed socks5 server connections * retry failed socks5 server connections
* allow UPnP lease duration to be changed after device discovery * allow UPnP lease duration to be changed after device discovery

View File

@ -367,15 +367,11 @@ namespace aux {
// trackers fail or not. // trackers fail or not.
use_dht_as_fallback, use_dht_as_fallback,
#if TORRENT_ABI_VERSION == 1
// ``upnp_ignore_nonrouters`` indicates whether or not the UPnP // ``upnp_ignore_nonrouters`` indicates whether or not the UPnP
// implementation should ignore any broadcast response from a device // implementation should ignore any broadcast response from a device
// whose address is not the configured router for this machine. i.e. // whose address is not on our subnet. i.e.
// it's a way to not talk to other people's routers by mistake. // it's a way to not talk to other people's routers by mistake.
upnp_ignore_nonrouters TORRENT_DEPRECATED_ENUM, upnp_ignore_nonrouters,
#else
deprecated_upnp_ignore_nonrouters,
#endif
// ``use_parole_mode`` specifies if parole mode should be used. Parole // ``use_parole_mode`` specifies if parole mode should be used. Parole
// mode means that peers that participate in pieces that fail the hash // mode means that peers that participate in pieces that fail the hash

View File

@ -135,7 +135,7 @@ constexpr int CLOSE_FILE_INTERVAL = 0;
SET(send_redundant_have, true, nullptr), SET(send_redundant_have, true, nullptr),
DEPRECATED_SET(lazy_bitfields, false, nullptr), DEPRECATED_SET(lazy_bitfields, false, nullptr),
SET(use_dht_as_fallback, false, nullptr), SET(use_dht_as_fallback, false, nullptr),
DEPRECATED_SET(upnp_ignore_nonrouters, false, nullptr), SET(upnp_ignore_nonrouters, false, nullptr),
SET(use_parole_mode, true, nullptr), SET(use_parole_mode, true, nullptr),
SET(use_read_cache, true, nullptr), SET(use_read_cache, true, nullptr),
DEPRECATED_SET(use_write_cache, true, nullptr), DEPRECATED_SET(use_write_cache, true, nullptr),

View File

@ -500,7 +500,8 @@ void upnp::on_reply(udp::socket& s, error_code const& ec)
if (err) return; if (err) return;
if (!match_addr_mask(m_listen_address, from.address(), m_netmask)) if (m_settings.get_bool(settings_pack::upnp_ignore_nonrouters)
&& !match_addr_mask(m_listen_address, from.address(), m_netmask))
{ {
#ifndef TORRENT_DISABLE_LOGGING #ifndef TORRENT_DISABLE_LOGGING
if (should_log()) if (should_log())