* unify CONFIG option for DHT stunner

* implement optional (turned off by default) usage of dht stunner to determin external ip (this can be usefull for some corner case setups)
This commit is contained in:
sehraf 2020-02-05 20:11:53 +01:00
parent e91d877af2
commit 6f9d875fc6
No known key found for this signature in database
GPG Key ID: DF09F6EAE356B2C6
2 changed files with 22 additions and 5 deletions

View File

@ -712,8 +712,10 @@ void p3NetMgrIMPL::netExtCheck()
}
#ifdef ALLOW_DHT_STUNNER
// (cyril) I disabled this because it's pretty dangerous. The DHT can report a wrong address quite easily
// if the other DHT peers are not collaborating.
// (cyril) I disabled this because it's pretty dangerous. The DHT can report a wrong address quite easily
// if the other DHT peers are not collaborating.
// (sehraf) For the record: The udp stunner uses multiple (as for now: two) peers to ensure that the IP recieved is the correct one, see UdpStunner::locked_checkExternalAddress()
// Nevertheless this stays a more risky method to determine the external ip address.
/* Next ask the DhtStunner */
{

View File

@ -113,9 +113,16 @@ no_bitdht:CONFIG -= bitdht
# The DHT stunner is used to determine the NAT type using other RS DHT peers and the STUN (Session Traversal Utilities for NAT) protocol.
# To disable DHT stunner append the following assignation to qmake command line
# "CONFIG+=no_useDhtStunner"
CONFIG *= useDhtStunner
no_useDhtStunner:CONFIG -= useDhtStunner
# "CONFIG+=no_use_dht_stunner"
CONFIG *= use_dht_stunner
no_use_dht_stunner:CONFIG -= use_dht_stunner
# The DHT stunner can be used to figure out our external IP. As this purely relying on random DHT peers that answer our request, it can easily be abused
# Therefore, it is turned off by default.
# To enable external ip determination (additionally) based on the dht stunner append the following assignation to qmake
# command line "CONFIG+=rs_async_chat"
CONFIG *= no_use_dht_stunner_ext_ip
use_dht_stunner_ext_ip:CONFIG -= no_use_dht_stunner_ext_ip
# To select your MacOsX version append the following assignation to qmake
# command line "CONFIG+=rs_macos10.11" where 10.11 depends your version
@ -498,6 +505,14 @@ rs_gxs_trans {
bitdht {
DEFINES *= RS_USE_BITDHT
use_dht_stunner {
CONFIG *= useDhtStunner
use_dht_stunner_ext_ip {
DEFINES *= ALLOW_DHT_STUNNER
}
}
}
direct_chat {