From a0fb5196962ddd885edba83c23c82376eae4e122 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 13 Aug 2019 12:58:14 -0700 Subject: [PATCH 1/3] Make sure libstdc++ is in RH spec file --- zerotier-one.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zerotier-one.spec b/zerotier-one.spec index 46e166fd9..6649e653e 100644 --- a/zerotier-one.spec +++ b/zerotier-one.spec @@ -14,7 +14,7 @@ BuildRequires: systemd BuildRequires: systemd %endif -Requires: iproute +Requires: iproute libstdc++ %if 0%{?rhel} >= 7 Requires: systemd From 1c7b553331bc2e1f688912108d1ab37fd8f0bd24 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 14 Aug 2019 10:47:58 -0700 Subject: [PATCH 2/3] GitHub issue #1000 --- osdep/LinuxNetLink.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osdep/LinuxNetLink.cpp b/osdep/LinuxNetLink.cpp index da75ccdf7..be6e22c3d 100644 --- a/osdep/LinuxNetLink.cpp +++ b/osdep/LinuxNetLink.cpp @@ -103,7 +103,11 @@ void LinuxNetLink::_setSocketTimeout(int fd, int seconds) #define ZT_NL_BUF_SIZE 16384 int LinuxNetLink::_doRecv(int fd) { - char *const buf = (char *)valloc(ZT_NL_BUF_SIZE); + char *buf = nullptr; + if (posix_memalign((void **)&buf,16,ZT_NL_BUF_SIZE) != 0) { + fprintf(stderr,"malloc failed!\n"); + ::exit(1); + } if (!buf) { fprintf(stderr,"malloc failed!\n"); ::exit(1); From 2ec53df7abe554a22c3bdd985cbe101e22aaef7c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 14 Aug 2019 10:52:21 -0700 Subject: [PATCH 3/3] Put a limit on the multicast TX queue to prevent memory use ridiculousness. --- node/Multicaster.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node/Multicaster.cpp b/node/Multicaster.cpp index 67e133c0e..a25b7f05a 100644 --- a/node/Multicaster.cpp +++ b/node/Multicaster.cpp @@ -275,6 +275,11 @@ void Multicaster::send( } } } else { + if (gs.txQueue.size() >= ZT_TX_QUEUE_SIZE) { + RR->t->outgoingNetworkFrameDropped(tPtr,network,src,mg.mac(),etherType,0,len,"multicast TX queue is full"); + return; + } + const unsigned int gatherLimit = (limit - (unsigned int)gs.members.size()) + 1; if ((gs.members.empty())||((now - gs.lastExplicitGather) >= ZT_MULTICAST_EXPLICIT_GATHER_DELAY)) {