From 91edf66743d18bec97b1c099366e62e343542a6b Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Thu, 7 Nov 2024 13:32:21 +0000 Subject: [PATCH] discards packets which are not (fully) populated (#3508) 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