Tear down routes before devices when leaving a network or shutting down.

This commit is contained in:
Adam Ierymenko 2021-09-02 17:56:06 -04:00
parent 1a1d7d9ada
commit d7ba2957cd
No known key found for this signature in database
GPG Key ID: C8877CF2D7A5D7F3

View File

@ -539,6 +539,15 @@ public:
memset(&config, 0, sizeof(ZT_VirtualNetworkConfig));
}
~NetworkState()
{
this->managedRoutes.clear();
#ifdef __APPLE__
Thread::sleep(10);
this->tap.reset();
#endif
}
std::shared_ptr<EthernetTap> tap;
ZT_VirtualNetworkConfig config; // memcpy() of raw config from core
std::vector<InetAddress> managedIps;