From 1b13e1da435348a3c2d20329e04b1a0d9b9ba345 Mon Sep 17 00:00:00 2001 From: Jeff Biseda Date: Wed, 16 Feb 2022 07:46:32 -0800 Subject: [PATCH] forward_buffered_packets return packet count in error path (#23167) (cherry picked from commit 115d71536b5fc23c1a745335f2e01caabac91f92) --- core/src/banking_stage.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index 1837336cfc59b7..f4bd2774467e3a 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -469,9 +469,9 @@ impl BankingStage { if !packet_vec.is_empty() { inc_new_counter_info!("banking_stage-forwarded_packets", packet_vec.len()); - if let Err(SendPktsError::IoError(ioerr, _num_failed)) = batch_send(socket, &packet_vec) + if let Err(SendPktsError::IoError(ioerr, num_failed)) = batch_send(socket, &packet_vec) { - return (Err(ioerr), 0); + return (Err(ioerr), packet_vec.len().saturating_sub(num_failed)); } }