summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--make-linux.mk12
-rw-r--r--netcon/NetconEthernetTap.cpp2
-rw-r--r--service/OneService.cpp15
3 files changed, 22 insertions, 7 deletions
diff --git a/make-linux.mk b/make-linux.mk
index 2ef9b985..1eb88ba3 100644
--- a/make-linux.mk
+++ b/make-linux.mk
@@ -29,15 +29,15 @@ endif
UNAME_M=$(shell uname -m)
INCLUDES=
-DEFS=
+DEFS=-DZT_ENABLE_NETCON
LDLIBS?=
include objects.mk
-OBJS+=osdep/LinuxEthernetTap.o
+OBJS+=osdep/LinuxEthernetTap.o netcon/NetconEthernetTap.o
# "make official" is a shortcut for this
ifeq ($(ZT_OFFICIAL_RELEASE),1)
- DEFS+=-DZT_OFFICIAL_RELEASE
+ DEFS+=-DZT_OFFICIAL_RELEASE
ZT_USE_MINIUPNPC=1
endif
@@ -65,14 +65,14 @@ endif
# Build with ZT_ENABLE_NETWORK_CONTROLLER=1 to build with the Sqlite network controller
ifeq ($(ZT_ENABLE_NETWORK_CONTROLLER),1)
- DEFS+=-DZT_ENABLE_NETWORK_CONTROLLER
+ DEFS+=-DZT_ENABLE_NETWORK_CONTROLLER
LDLIBS+=-L/usr/local/lib -lsqlite3
- OBJS+=controller/SqliteNetworkController.o
+ OBJS+=controller/SqliteNetworkController.o
endif
# "make debug" is a shortcut for this
ifeq ($(ZT_DEBUG),1)
- DEFS+=-DZT_TRACE
+ DEFS+=-DZT_TRACE
CFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS)
CXXFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS)
LDFLAGS=
diff --git a/netcon/NetconEthernetTap.cpp b/netcon/NetconEthernetTap.cpp
index 578b836e..fe1dac83 100644
--- a/netcon/NetconEthernetTap.cpp
+++ b/netcon/NetconEthernetTap.cpp
@@ -62,7 +62,7 @@ NetconEthernetTap::NetconEthernetTap(
_dev = sockPath;
_unixListenSocket = _phy.unixListen(sockPath,(void *)this);
- if (!_unixSocket)
+ if (!_unixListenSocket)
throw std::runtime_error(std::string("unable to bind to ")+sockPath);
_thread = Thread::start(this);
diff --git a/service/OneService.cpp b/service/OneService.cpp
index f7ea2130..2cbbbcd7 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -90,22 +90,37 @@ class SqliteNetworkController;
#endif
// Include the right tap device driver for this platform -- add new platforms here
+#ifdef ZT_ENABLE_NETCON
+
+#include "../netcon/NetconEthernetTap.hpp"
+namespace ZeroTier { typedef NetconEthernetTap EthernetTap; }
+
+#else
#ifdef __APPLE__
+
#include "../osdep/OSXEthernetTap.hpp"
namespace ZeroTier { typedef OSXEthernetTap EthernetTap; }
+
#endif
#ifdef __LINUX__
+
#include "../osdep/LinuxEthernetTap.hpp"
namespace ZeroTier { typedef LinuxEthernetTap EthernetTap; }
+
#endif
#ifdef __WINDOWS__
+
#include "../osdep/WindowsEthernetTap.hpp"
namespace ZeroTier { typedef WindowsEthernetTap EthernetTap; }
+
#endif
#ifdef __FreeBSD__
+
#include "../osdep/BSDEthernetTap.hpp"
namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
+
#endif
+#endif // ZT_ENABLE_NETCON
// Sanity limits for HTTP
#define ZT_MAX_HTTP_MESSAGE_SIZE (1024 * 1024 * 64)