File tree 1 file changed +3
-0
lines changed
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -1036,6 +1036,7 @@ async fn auto_mtu_detection(
1036
1036
1037
1037
let res = set
1038
1038
. map ( |res| match res {
1039
+ // Map successful pings to packet size
1039
1040
Ok ( ( packet, _rtt) ) => {
1040
1041
let surge_ping:: IcmpPacket :: V4 ( packet) = packet else {
1041
1042
panic ! ( "ICMP ping response was not of IPv4 type" ) ;
@@ -1045,10 +1046,12 @@ async fn auto_mtu_detection(
1045
1046
debug_assert_eq ! ( size, linspace[ packet. get_sequence( ) . 0 as usize ] ) ;
1046
1047
Ok ( Some ( size) )
1047
1048
}
1049
+ // Filter out dropped pings
1048
1050
Err ( SurgeError :: Timeout { seq } ) => {
1049
1051
log:: info!( "Ping of size {} dropped" , linspace[ seq. 0 as usize ] ) ;
1050
1052
Ok ( None )
1051
1053
}
1054
+ // Short circuit and return error on unexpected error types
1052
1055
Err ( e) => Err ( e) ,
1053
1056
} )
1054
1057
. try_fold ( None , |acc, x| async move { Ok ( std:: cmp:: max ( acc, x) ) } )
You can’t perform that action at this time.
0 commit comments