From de0ce73023fec2291c9e86dd8ed6c9cdaef7b9ae Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Thu, 7 Dec 2017 16:45:02 -0800 Subject: [PATCH] Temporarily removed DNS support to prevent TLS h_errno conflict. Updated CMakeLists --- CMakeLists.txt | 4 ++-- include/VirtualTap.h | 2 +- include/lwipopts.h | 2 +- src/libzt.cpp | 10 +++++++--- src/lwIP.cpp | 2 ++ 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d9ac82..e6ffc62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,9 +53,10 @@ include_directories("${PROJ_DIR}/zto/node") include_directories("${PROJ_DIR}/zto/service") file(GLOB zto_src_glob "${ZTO_SRC_DIR}/node/*.cpp" "${ZTO_SRC_DIR}/service/*.cpp" "${ZTO_SRC_DIR}/osdep/OSUtils.cpp" "${ZTO_SRC_DIR}/controller/*.cpp" "${ZTO_SRC_DIR}/osdep/ManagedRoute.cpp") add_library(zto ${zto_src_glob}) +add_dependencies(zto zt) add_library(httpparser "${ZTO_SRC_DIR}/ext/http-parser/http_parser.c") target_compile_options(zto PRIVATE -std=c++11 -DZT_SDK=1) -target_link_libraries(zto httpparser) +target_link_libraries(zto httpparser zt) # libzt set(LIBZT_SRC_DIR ${PROJ_DIR}/src) @@ -63,7 +64,6 @@ include_directories("${LIBZT_SRC_DIR}") include_directories("${PROJ_DIR}/include") file(GLOB libzt_src_glob ${LIBZT_SRC_DIR}/*.cpp) add_library(zt ${libzt_src_glob}) -add_dependencies(zt zto) target_compile_options(zt PRIVATE -std=c++11 -DZT_SDK=1 -DLIBZT_TRACE=1) target_link_libraries(zt zto) target_link_libraries(zt lwip) diff --git a/include/VirtualTap.h b/include/VirtualTap.h index ab877d4..4d9829b 100644 --- a/include/VirtualTap.h +++ b/include/VirtualTap.h @@ -225,7 +225,7 @@ public: Mutex _pico_frame_rxbuf_m; #endif - std::vector> routes; + std::vector > routes; void *zt1ServiceRef = NULL; char vtap_full_name[64]; diff --git a/include/lwipopts.h b/include/lwipopts.h index 047014d..b3fbf7a 100644 --- a/include/lwipopts.h +++ b/include/lwipopts.h @@ -514,7 +514,7 @@ happening sooner than they should. * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS * transport. */ -#define LWIP_DNS 1 +#define LWIP_DNS 0 #define LWIP_DNS_API_DECLARE_H_ERRNO 1 /*------------------------------------------------------------------------------ diff --git a/src/libzt.cpp b/src/libzt.cpp index 8d89ffc..2170c97 100644 --- a/src/libzt.cpp +++ b/src/libzt.cpp @@ -36,7 +36,7 @@ #include "lwip/sockets.h" #include "lwip/ip_addr.h" #include "lwip/netdb.h" -#include "dns.h" +//#include "dns.h" #endif #if defined(NO_STACK) #include @@ -291,6 +291,7 @@ int zts_sethostname(const char *name, size_t len) #endif } +/* struct hostent *zts_gethostbyname(const char *name) { if (zts_ready() == false) { @@ -302,7 +303,7 @@ struct hostent *zts_gethostbyname(const char *name) #endif #if defined(ZT_LWIP_SEQ_SOCKET) // TODO: Test thread safety - /* + char buf[256]; int buflen = 256; int h_err = 0; @@ -316,7 +317,7 @@ struct hostent *zts_gethostbyname(const char *name) return NULL; // failure } return *result; - */ + return lwip_gethostbyname(name); #endif #if defined(ZT_PICO_BSD_SOCKET) @@ -325,6 +326,7 @@ struct hostent *zts_gethostbyname(const char *name) #endif return NULL; } +*/ int zts_close(int fd) { @@ -606,6 +608,7 @@ int zts_shutdown(int fd, int how) #endif } +/* int zts_add_dns_nameserver(struct sockaddr *addr) { DEBUG_EXTRA(); @@ -646,6 +649,7 @@ int zts_del_dns_nameserver(struct sockaddr *addr) return -1; #endif } +*/ /* The rationale for the following correctional methods is as follows: diff --git a/src/lwIP.cpp b/src/lwIP.cpp index ac994f5..b76f0af 100644 --- a/src/lwIP.cpp +++ b/src/lwIP.cpp @@ -280,10 +280,12 @@ void lwip_eth_rx(VirtualTap *tap, const ZeroTier::MAC &from, const ZeroTier::MAC } } +/* void lwip_dns_init() { dns_init(); } +*/ void lwip_start_dhcp(void *netif) {