Switch to MEM_LIBC_MALLOC usage in lwIP. Added event callbacks. Use of finer-grained locks in RX logic. CRCs disabled on inbound packets

This commit is contained in:
Joseph Henry
2019-01-25 12:42:53 -08:00
parent 2ac133b435
commit 068013d0f7
15 changed files with 3310 additions and 724 deletions

17
ext/ZeroTierOne.patch Normal file
View File

@@ -0,0 +1,17 @@
diff --git a/service/OneService.cpp b/service/OneService.cpp
index a1c53764..757863a8 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -2244,6 +2244,12 @@ public:
#endif
syncManagedStuff(n,true,true);
n.tap->setMtu(nwc->mtu);
+#if defined(ZT_SDK)
+ // Inform the virtual tap of the update
+ if (op == ZT_VIRTUAL_NETWORK_CONFIG_OPERATION_CONFIG_UPDATE) {
+ n.tap->lastConfigUpdate(OSUtils::now());
+ }
+#endif
} else {
_nets.erase(nwid);
return -999; // tap init failed

View File

@@ -1,16 +1,33 @@
diff --git a/ports/unix/port/include/arch/cc.h b/ports/unix/port/include/arch/cc.h
index a3dac04..39fede7 100644
index a3dac04..424285e 100644
--- a/ports/unix/port/include/arch/cc.h
+++ b/ports/unix/port/include/arch/cc.h
@@ -34,7 +34,7 @@
@@ -32,6 +32,8 @@
#ifndef LWIP_ARCH_CC_H
#define LWIP_ARCH_CC_H
+#include "include/Debug.hpp"
+
/* see https://sourceforge.net/p/predef/wiki/OperatingSystems/ */
#if defined __ANDROID__
-#define LWIP_UNIX_ANDROID
+//#define LWIP_UNIX_ANDROID
#elif defined __linux__
#define LWIP_UNIX_LINUX
#elif defined __APPLE__
#define LWIP_UNIX_ANDROID
@@ -55,7 +57,7 @@
#endif
#if defined(LWIP_UNIX_ANDROID) && defined(FD_SET)
-typedef __kernel_fd_set fd_set;
+//typedef __kernel_fd_set fd_set;
#endif
struct sio_status_s;
@@ -63,4 +65,7 @@ typedef struct sio_status_s sio_status_t;
#define sio_fd_t sio_status_t*
#define __sio_fd_t_defined
+// Comment out the following line to use lwIP's default diagnostic printing routine
+#define LWIP_PLATFORM_DIAG(x) do {DEBUG_INFO x;} while(0)
+
#endif /* LWIP_ARCH_CC_H */
diff --git a/ports/win32/include/arch/cc.h b/ports/win32/include/arch/cc.h
index 334be07..9384b70 100644
--- a/ports/win32/include/arch/cc.h