diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cb058ce..6fd16861 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.20) if(NOT ZITI_SDK_C_BRANCH) #allow using a different branch of the CSDK easily - set(ZITI_SDK_C_BRANCH "0.30.2") + set(ZITI_SDK_C_BRANCH "0.30.4") endif() # if TUNNEL_SDK_ONLY then don't descend into programs/ziti-edge-tunnel diff --git a/lib/ziti-tunnel/CMakeLists.txt b/lib/ziti-tunnel/CMakeLists.txt index 9adb3d28..a34f80de 100644 --- a/lib/ziti-tunnel/CMakeLists.txt +++ b/lib/ziti-tunnel/CMakeLists.txt @@ -35,6 +35,7 @@ set (LWIP_INCLUDE_DIRS include(${LWIP_DIR}/src/Filelists.cmake) target_sources(lwipcore PRIVATE ${lwip_sys_srcs} lwip/lwiphooks_ip6.c lwip/lwiphooks_ip4.c lwip/lwip_cloned_fns.c) +target_compile_definitions(lwipcore PUBLIC CMAKE_C_BYTE_ORDER=${CMAKE_C_BYTE_ORDER}) target_include_directories(ziti-tunnel-sdk-c PUBLIC ${LWIP_INCLUDE_DIRS} diff --git a/lib/ziti-tunnel/intercept.c b/lib/ziti-tunnel/intercept.c index 01eba6f7..c681253e 100644 --- a/lib/ziti-tunnel/intercept.c +++ b/lib/ziti-tunnel/intercept.c @@ -108,7 +108,6 @@ const ziti_address *address_match(const ziti_address *addr, const address_list_t STAILQ_FOREACH(a, addresses, entries) { score = ziti_address_match(addr, &a->za); - TNL_LOG(VERBOSE, "ziti_address_match score %d", score); if (score < 0) continue; if (best_score == -1 || score < best_score) { best_score = score; diff --git a/lib/ziti-tunnel/lwip/lwipopts.h b/lib/ziti-tunnel/lwip/lwipopts.h index 06c1be93..4b4952c4 100644 --- a/lib/ziti-tunnel/lwip/lwipopts.h +++ b/lib/ziti-tunnel/lwip/lwipopts.h @@ -60,6 +60,16 @@ #define LWIP_NO_UNISTD_H 1 #endif +#ifndef BYTE_ORDER +// make sure BYTE_ORDER is defined early, otherwise lwip sources will be compiled with inconsistent values. +#define BYTE_ORDER CMAKE_C_BYTE_ORDER // define BYTE_ORDER before including arch.h. the default is dumb. +#include "lwip/arch.h" // defines BIG_ENDIAN, etc + +#if (BYTE_ORDER != LITTLE_ENDIAN && BYTE_ORDER != BIG_ENDIAN) +#error "BYTE_ORDER is not defined" +#endif +#endif + // hooks #define LWIP_HOOK_FILENAME "lwiphooks.h" #define LWIP_HOOK_IP4_INPUT(pbuf, input_netif) ip4_input_hook((pbuf),(input_netif))