diff --git a/src/VirtualTap.cpp b/src/VirtualTap.cpp index bc00a77..d0e1b45 100644 --- a/src/VirtualTap.cpp +++ b/src/VirtualTap.cpp @@ -719,10 +719,11 @@ namespace ZeroTier { Mutex::Lock _l(_tcpconns_m); std::time_t current_ts = std::time(nullptr); if (current_ts > last_housekeeping_ts + ZT_HOUSEKEEPING_INTERVAL) { + DEBUG_EXTRA(); // update managed routes (add/del from network stacks) ZeroTier::OneService *service = ((ZeroTier::OneService *)zt1ServiceRef); if (service) { - std::vector *managed_routes = service->getRoutes(this->_nwid); + std::unique_ptr> managed_routes(service->getRoutes(this->_nwid)); ZeroTier::InetAddress target_addr; ZeroTier::InetAddress via_addr; ZeroTier::InetAddress null_addr; @@ -772,6 +773,7 @@ namespace ZeroTier { } } } + // TODO: Clean up VirtualSocket objects last_housekeeping_ts = std::time(nullptr); } diff --git a/src/VirtualTap.hpp b/src/VirtualTap.hpp index 90d2f80..3304098 100644 --- a/src/VirtualTap.hpp +++ b/src/VirtualTap.hpp @@ -251,7 +251,7 @@ namespace ZeroTier { * Timestamp of last run of housekeeping * SEE: ZT_HOUSEKEEPING_INTERVAL in libzt.h */ - std::time_t last_housekeeping_ts; + std::time_t last_housekeeping_ts = 0; /****************************************************************************/ /* In these, we will call the stack's corresponding functions, this is */