forward_buffered_packets return packet count in error path (#23167) (#23187)

(cherry picked from commit 115d71536b)

Co-authored-by: Jeff Biseda <jbiseda@gmail.com>
This commit is contained in:
mergify[bot]
2022-02-16 13:01:16 -08:00
committed by GitHub
parent e343a17ce9
commit 8b12749f02

View File

@ -475,9 +475,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));
}
}