mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Fix crash on uninitialized taps.
This commit is contained in:
parent
742261c7fc
commit
d0b506c12b
1 changed files with 9 additions and 2 deletions
|
@ -60,8 +60,11 @@ Network::~Network()
|
||||||
{
|
{
|
||||||
Thread::join(_setupThread);
|
Thread::join(_setupThread);
|
||||||
|
|
||||||
std::string devPersistentId(_tap->persistentId());
|
std::string devPersistentId;
|
||||||
delete _tap;
|
if (_tap) {
|
||||||
|
devPersistentId = _tap->persistentId();
|
||||||
|
delete _tap;
|
||||||
|
}
|
||||||
|
|
||||||
if (_destroyOnDelete) {
|
if (_destroyOnDelete) {
|
||||||
Utils::rm(std::string(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + idString() + ".conf"));
|
Utils::rm(std::string(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + idString() + ".conf"));
|
||||||
|
@ -296,9 +299,13 @@ void Network::threadMain()
|
||||||
_nc->putLocalConfig(lcentry,dn);
|
_nc->putLocalConfig(lcentry,dn);
|
||||||
#endif
|
#endif
|
||||||
} catch (std::exception &exc) {
|
} catch (std::exception &exc) {
|
||||||
|
delete _tap;
|
||||||
|
_tap = (EthernetTap *)0;
|
||||||
LOG("network %.16llx failed to initialize: %s",_id,exc.what());
|
LOG("network %.16llx failed to initialize: %s",_id,exc.what());
|
||||||
_netconfFailure = NETCONF_FAILURE_INIT_FAILED;
|
_netconfFailure = NETCONF_FAILURE_INIT_FAILED;
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
|
delete _tap;
|
||||||
|
_tap = (EthernetTap *)0;
|
||||||
LOG("network %.16llx failed to initialize: unknown error",_id);
|
LOG("network %.16llx failed to initialize: unknown error",_id);
|
||||||
_netconfFailure = NETCONF_FAILURE_INIT_FAILED;
|
_netconfFailure = NETCONF_FAILURE_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue