mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-02 03:06:40 +00:00
Choose which tap to use (feth or kext) on Mac based on Darwin version.
This commit is contained in:
parent
aca31c7055
commit
237c379866
@ -19,7 +19,7 @@ ZT_VERSION_BUILD=$(shell cat version.h | grep -F VERSION_BUILD | cut -d ' ' -f 3
|
|||||||
DEFS+=-DZT_BUILD_PLATFORM=$(ZT_BUILD_PLATFORM) -DZT_BUILD_ARCHITECTURE=$(ZT_BUILD_ARCHITECTURE)
|
DEFS+=-DZT_BUILD_PLATFORM=$(ZT_BUILD_PLATFORM) -DZT_BUILD_ARCHITECTURE=$(ZT_BUILD_ARCHITECTURE)
|
||||||
|
|
||||||
include objects.mk
|
include objects.mk
|
||||||
ONE_OBJS+=osdep/MacEthernetTap.o ext/http-parser/http_parser.o
|
ONE_OBJS+=osdep/MacEthernetTap.o osdep/MacKextEthernetTap.o ext/http-parser/http_parser.o
|
||||||
|
|
||||||
ifeq ($(ZT_CONTROLLER),1)
|
ifeq ($(ZT_CONTROLLER),1)
|
||||||
LIBS+=-lpq -lrabbitmq
|
LIBS+=-lpq -lrabbitmq
|
||||||
|
@ -34,6 +34,7 @@ ONE_OBJS=\
|
|||||||
controller/LFDB.o \
|
controller/LFDB.o \
|
||||||
controller/PostgreSQL.o \
|
controller/PostgreSQL.o \
|
||||||
controller/RabbitMQ.o \
|
controller/RabbitMQ.o \
|
||||||
|
osdep/EthernetTap.o \
|
||||||
osdep/ManagedRoute.o \
|
osdep/ManagedRoute.o \
|
||||||
osdep/Http.o \
|
osdep/Http.o \
|
||||||
osdep/OSUtils.o \
|
osdep/OSUtils.o \
|
||||||
|
@ -118,30 +118,7 @@ namespace ZeroTier { typedef VirtualTap EthernetTap; }
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#include "../osdep/EthernetTap.hpp"
|
||||||
#include "../osdep/MacEthernetTap.hpp"
|
|
||||||
namespace ZeroTier { typedef MacEthernetTap EthernetTap; }
|
|
||||||
#endif // __APPLE__
|
|
||||||
#ifdef __LINUX__
|
|
||||||
#include "../osdep/LinuxEthernetTap.hpp"
|
|
||||||
namespace ZeroTier { typedef LinuxEthernetTap EthernetTap; }
|
|
||||||
#endif // __LINUX__
|
|
||||||
#ifdef __WINDOWS__
|
|
||||||
#include "../osdep/WindowsEthernetTap.hpp"
|
|
||||||
namespace ZeroTier { typedef WindowsEthernetTap EthernetTap; }
|
|
||||||
#endif // __WINDOWS__
|
|
||||||
#ifdef __FreeBSD__
|
|
||||||
#include "../osdep/BSDEthernetTap.hpp"
|
|
||||||
namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
|
|
||||||
#endif // __FreeBSD__
|
|
||||||
#ifdef __NetBSD__
|
|
||||||
#include "../osdep/NetBSDEthernetTap.hpp"
|
|
||||||
namespace ZeroTier { typedef NetBSDEthernetTap EthernetTap; }
|
|
||||||
#endif // __NetBSD__
|
|
||||||
#ifdef __OpenBSD__
|
|
||||||
#include "../osdep/BSDEthernetTap.hpp"
|
|
||||||
namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
|
|
||||||
#endif // __OpenBSD__
|
|
||||||
|
|
||||||
#endif // ZT_SDK
|
#endif // ZT_SDK
|
||||||
|
|
||||||
@ -543,7 +520,7 @@ public:
|
|||||||
settings.allowDefault = false;
|
settings.allowDefault = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
EthernetTap *tap;
|
std::shared_ptr<EthernetTap> tap;
|
||||||
ZT_VirtualNetworkConfig config; // memcpy() of raw config from core
|
ZT_VirtualNetworkConfig config; // memcpy() of raw config from core
|
||||||
std::vector<InetAddress> managedIps;
|
std::vector<InetAddress> managedIps;
|
||||||
std::list< SharedPtr<ManagedRoute> > managedRoutes;
|
std::list< SharedPtr<ManagedRoute> > managedRoutes;
|
||||||
@ -955,8 +932,6 @@ public:
|
|||||||
|
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_nets_m);
|
Mutex::Lock _l(_nets_m);
|
||||||
for(std::map<uint64_t,NetworkState>::iterator n(_nets.begin());n!=_nets.end();++n)
|
|
||||||
delete n->second.tap;
|
|
||||||
_nets.clear();
|
_nets.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2142,7 +2117,8 @@ public:
|
|||||||
char friendlyName[128];
|
char friendlyName[128];
|
||||||
OSUtils::ztsnprintf(friendlyName,sizeof(friendlyName),"ZeroTier One [%.16llx]",nwid);
|
OSUtils::ztsnprintf(friendlyName,sizeof(friendlyName),"ZeroTier One [%.16llx]",nwid);
|
||||||
|
|
||||||
n.tap = new EthernetTap(
|
n.tap = EthernetTap::newInstance(
|
||||||
|
nullptr,
|
||||||
_homePath.c_str(),
|
_homePath.c_str(),
|
||||||
MAC(nwc->mac),
|
MAC(nwc->mac),
|
||||||
nwc->mtu,
|
nwc->mtu,
|
||||||
@ -2232,7 +2208,7 @@ public:
|
|||||||
std::string winInstanceId(n.tap->instanceId());
|
std::string winInstanceId(n.tap->instanceId());
|
||||||
#endif
|
#endif
|
||||||
*nuptr = (void *)0;
|
*nuptr = (void *)0;
|
||||||
delete n.tap;
|
n.tap.reset();
|
||||||
_nets.erase(nwid);
|
_nets.erase(nwid);
|
||||||
#if defined(__WINDOWS__) && !defined(ZT_SDK)
|
#if defined(__WINDOWS__) && !defined(ZT_SDK)
|
||||||
if ((op == ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY)&&(winInstanceId.length() > 0))
|
if ((op == ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_DESTROY)&&(winInstanceId.length() > 0))
|
||||||
|
Loading…
Reference in New Issue
Block a user