mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 04:57:53 +00:00
Fix reporting of status.
This commit is contained in:
parent
6b3a7ec827
commit
6ce71c1bc3
@ -194,6 +194,7 @@ bool IncomingPacket::_doERROR(const RuntimeEnvironment *RR,void *tPtr,const Shar
|
||||
case Packet::ERROR_NETWORK_AUTHENTICATION_REQUIRED: {
|
||||
const SharedPtr<Network> network(RR->node->network(at<uint64_t>(ZT_PROTO_VERB_ERROR_IDX_PAYLOAD)));
|
||||
if ((network)&&(network->controller() == peer->address())) {
|
||||
bool noUrl = true;
|
||||
int s = (int)size() - (ZT_PROTO_VERB_ERROR_IDX_PAYLOAD + 8);
|
||||
if (s > 2) {
|
||||
const uint16_t errorDataSize = at<uint16_t>(ZT_PROTO_VERB_ERROR_IDX_PAYLOAD + 8);
|
||||
@ -204,11 +205,12 @@ bool IncomingPacket::_doERROR(const RuntimeEnvironment *RR,void *tPtr,const Shar
|
||||
if (authInfo.get("aU", authenticationURL, sizeof(authenticationURL)) > 0) {
|
||||
authenticationURL[sizeof(authenticationURL) - 1] = 0; // ensure always zero terminated
|
||||
network->setAuthenticationRequired(authenticationURL);
|
||||
} else {
|
||||
network->setAuthenticationRequired("");
|
||||
noUrl = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (noUrl)
|
||||
network->setAuthenticationRequired("");
|
||||
}
|
||||
} break;
|
||||
|
||||
|
@ -1379,6 +1379,8 @@ ZT_VirtualNetworkStatus Network::_status() const
|
||||
return ZT_NETWORK_STATUS_NOT_FOUND;
|
||||
case NETCONF_FAILURE_NONE:
|
||||
return ((_config) ? ZT_NETWORK_STATUS_OK : ZT_NETWORK_STATUS_REQUESTING_CONFIGURATION);
|
||||
case NETCONF_FAILURE_AUTHENTICATION_REQUIRED:
|
||||
return ZT_NETWORK_STATUS_AUTHENTICATION_REQUIRED;
|
||||
default:
|
||||
return ZT_NETWORK_STATUS_PORT_ERROR;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user