File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ impl SigVerifyStage {
195
195
. iter_mut ( )
196
196
. rev ( )
197
197
. flat_map ( |batch| batch. packets . iter_mut ( ) . rev ( ) )
198
+ . filter ( |packet| !packet. meta . discard ( ) )
198
199
. map ( |packet| ( packet. meta . addr , packet) )
199
200
. into_group_map ( ) ;
200
201
// Allocate max_packets evenly across addresses.
@@ -372,11 +373,14 @@ mod tests {
372
373
let mut batch = PacketBatch :: default ( ) ;
373
374
batch. packets . resize ( 10 , Packet :: default ( ) ) ;
374
375
batch. packets [ 3 ] . meta . addr = std:: net:: IpAddr :: from ( [ 1u16 ; 8 ] ) ;
376
+ batch. packets [ 3 ] . meta . set_discard ( true ) ;
377
+ batch. packets [ 4 ] . meta . addr = std:: net:: IpAddr :: from ( [ 2u16 ; 8 ] ) ;
375
378
let mut batches = vec ! [ batch] ;
376
379
let max = 3 ;
377
380
SigVerifyStage :: discard_excess_packets ( & mut batches, max) ;
378
381
assert_eq ! ( count_non_discard( & batches) , max) ;
379
382
assert ! ( !batches[ 0 ] . packets[ 0 ] . meta. discard( ) ) ;
380
- assert ! ( !batches[ 0 ] . packets[ 3 ] . meta. discard( ) ) ;
383
+ assert ! ( batches[ 0 ] . packets[ 3 ] . meta. discard( ) ) ;
384
+ assert ! ( !batches[ 0 ] . packets[ 4 ] . meta. discard( ) ) ;
381
385
}
382
386
}
You can’t perform that action at this time.
0 commit comments