mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-28 16:17:28 -04:00
Avoid external port being reset without necessity
Fix RetroSahre behaviour when manually configured external port is different to local port
This commit is contained in:
parent
966cd27cd7
commit
e5805e9047
2 changed files with 37 additions and 18 deletions
|
@ -301,7 +301,21 @@ void netUnreachableCheck();
|
|||
void updateNetStateBox_temporal();
|
||||
void updateNetStateBox_startup();
|
||||
void updateNetStateBox_reset();
|
||||
void updateNatSetting();
|
||||
void updateNatSetting();
|
||||
|
||||
/** Conservatively guess new external port, previous approach (aka always
|
||||
* reset it to local port) break setups where external manually
|
||||
* forwarded port is different then local port. A common case is having
|
||||
* SSLH listening on port 80 on the router with public IP forwanding
|
||||
* plain HTTP connections to a web server and --anyprot connections to
|
||||
* retroshare to make censor/BOFH/bad firewall life a little more
|
||||
* difficult */
|
||||
uint16_t guessNewExtPort()
|
||||
{
|
||||
uint16_t newExtPort = sockaddr_storage_port(mExtAddr);
|
||||
if(!newExtPort) newExtPort = sockaddr_storage_port(mLocalAddr);
|
||||
return newExtPort;
|
||||
}
|
||||
|
||||
private:
|
||||
// These should have there own Mutex Protection,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue