Destroy tap devices on Windows 'leave'.
This commit is contained in:
parent
e2c65bf16a
commit
ce09e363dc
3 changed files with 31 additions and 24 deletions
|
@ -461,9 +461,16 @@ public:
|
|||
case ZT1_VIRTUAL_NETWORK_CONFIG_OPERATION_DOWN:
|
||||
case ZT1_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY:
|
||||
if (t != _taps.end()) {
|
||||
#ifdef __WINDOWS__
|
||||
std::string winInstanceId(t->second->instanceId());
|
||||
#endif
|
||||
delete t->second;
|
||||
_taps.erase(t);
|
||||
_tapAssignedIps.erase(nwid);
|
||||
#ifdef __WINDOWS__
|
||||
if ((op == ZT1_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY)&&(winInstanceId.length() > 0))
|
||||
WindowsEthernetTap::deletePersistentTapDevice(_homePath.c_str(),winInstanceId.c_str());
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue