diff --git a/src/socket/tcp.rs b/src/socket/tcp.rs index f884cd78d..1a2eec54c 100644 --- a/src/socket/tcp.rs +++ b/src/socket/tcp.rs @@ -3072,7 +3072,7 @@ mod test { ack_number: Some(REMOTE_SEQ + 1), max_seg_size: Some(BASE_MSS), window_scale: Some(*shift_amt), - window_len: cmp::min(*buffer_size, 65535) as u16, + window_len: u16::try_from(*buffer_size).unwrap_or(u16::MAX), ..RECV_TEMPL }] ); @@ -3750,7 +3750,7 @@ mod test { ack_number: None, max_seg_size: Some(BASE_MSS), window_scale: Some(*shift_amt), - window_len: cmp::min(*buffer_size, 65535) as u16, + window_len: u16::try_from(*buffer_size).unwrap_or(u16::MAX), sack_permitted: true, ..RECV_TEMPL }]