From 2ec53df7abe554a22c3bdd985cbe101e22aaef7c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 14 Aug 2019 10:52:21 -0700 Subject: [PATCH] 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)) {