Added ZTS_EVENT_NETWORK_DOWN to tap destructor

This commit is contained in:
Joseph Henry
2019-02-07 14:33:23 -08:00
parent 1f8d3030c8
commit c8e6662d24

View File

@@ -36,8 +36,6 @@
#include "OSUtils.hpp" #include "OSUtils.hpp"
#include "Service.hpp" #include "Service.hpp"
extern void _push_callback_event(uint64_t nwid, int eventCode);
#include "Mutex.hpp" #include "Mutex.hpp"
#include "lwipDriver.hpp" #include "lwipDriver.hpp"
#include "libzt.h" #include "libzt.h"
@@ -49,8 +47,8 @@ extern void _push_callback_event(uint64_t nwid, int eventCode);
namespace ZeroTier { namespace ZeroTier {
class VirtualTap; class VirtualTap;
extern OneService *service; extern OneService *service;
extern void postEvent(uint64_t id, int eventCode);
/** /**
* A virtual tap device. The ZeroTier core service creates one of these for each * A virtual tap device. The ZeroTier core service creates one of these for each
@@ -88,6 +86,7 @@ VirtualTap::VirtualTap(
VirtualTap::~VirtualTap() VirtualTap::~VirtualTap()
{ {
postEvent(_nwid, ZTS_EVENT_NETWORK_DOWN);
_run = false; _run = false;
::write(_shutdownSignalPipe[1],"\0",1); ::write(_shutdownSignalPipe[1],"\0",1);
_phy.whack(); _phy.whack();