mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Merge pull request #1364 from Pablohn26/master
Show the port number which is not able to connect
This commit is contained in:
commit
a7f652781f
1 changed files with 4 additions and 1 deletions
|
@ -676,6 +676,9 @@ public:
|
||||||
readLocalSettings();
|
readLocalSettings();
|
||||||
applyLocalConfig();
|
applyLocalConfig();
|
||||||
|
|
||||||
|
// Save original port number to show it if bind error
|
||||||
|
const int _configuredPort = _primaryPort;
|
||||||
|
|
||||||
// Make sure we can use the primary port, and hunt for one if configured to do so
|
// Make sure we can use the primary port, and hunt for one if configured to do so
|
||||||
const int portTrials = (_primaryPort == 0) ? 256 : 1; // if port is 0, pick random
|
const int portTrials = (_primaryPort == 0) ? 256 : 1; // if port is 0, pick random
|
||||||
for(int k=0;k<portTrials;++k) {
|
for(int k=0;k<portTrials;++k) {
|
||||||
|
@ -693,7 +696,7 @@ public:
|
||||||
if (_ports[0] == 0) {
|
if (_ports[0] == 0) {
|
||||||
Mutex::Lock _l(_termReason_m);
|
Mutex::Lock _l(_termReason_m);
|
||||||
_termReason = ONE_UNRECOVERABLE_ERROR;
|
_termReason = ONE_UNRECOVERABLE_ERROR;
|
||||||
_fatalErrorMessage = "cannot bind to local control interface port";
|
_fatalErrorMessage = std::string("cannot bind to local control interface port ")+std::to_string(_configuredPort);
|
||||||
return _termReason;
|
return _termReason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue