Prevent packet loops and duplicates
Implement a "seen packets" table to track packets that have already been processed by the serial bridge. This prevents packets from being re-transmitted over the serial link if they have already been seen, and it stops inbound packets from serial from being re-injected into the mesh if they are duplicates. Duplicate inbound packets are now freed to prevent memory leaks.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "helpers/AbstractBridge.h"
|
||||
#include "helpers/SimpleMeshTables.h"
|
||||
#include <Stream.h>
|
||||
|
||||
#ifdef BRIDGE_OVER_SERIAL
|
||||
@@ -25,6 +26,7 @@ public:
|
||||
private:
|
||||
Stream* _serial;
|
||||
mesh::PacketManager* _mgr;
|
||||
SimpleMeshTables _seen_packets;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user