From 93efcdaa745bb132f3dfd82ef8404711add4ea96 Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Wed, 6 Nov 2024 15:55:09 -0600 Subject: [PATCH] discards packets which are not (fully) populated Not discarding packets which are not (fully) populated is bug prone or might waste resources. --- perf/src/packet.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/perf/src/packet.rs b/perf/src/packet.rs index 17c49069cd8514..64bc4366ea431e 100644 --- a/perf/src/packet.rs +++ b/perf/src/packet.rs @@ -90,9 +90,11 @@ impl PacketBatch { // break the payload into smaller messages, and here any errors // should be propagated. error!("Couldn't write to packet {:?}. Data skipped.", e); + packet.meta_mut().set_discard(true); } } else { trace!("Dropping packet, as destination is unknown"); + packet.meta_mut().set_discard(true); } } batch