diff --git a/src/vmm/src/dumbo/tcp/endpoint.rs b/src/vmm/src/dumbo/tcp/endpoint.rs index e1015e8211fe..c068ec73323b 100644 --- a/src/vmm/src/dumbo/tcp/endpoint.rs +++ b/src/vmm/src/dumbo/tcp/endpoint.rs @@ -223,7 +223,10 @@ impl Endpoint { // We have to remove the bytes up to end from receive_buf, by shifting the // others to the beginning of the buffer, and updating receive_buf_left. // Also, advance the rwnd edge of the inner connection. - b.copy_within(end.., 0); + // TODO: Maximum efficiency. + for j in 0..b.len() - end { + b[j] = b[j + end]; + } self.receive_buf_left -= end; // Safe to unwrap because we assert that the response buffer is small // enough. @@ -647,4 +650,4 @@ mod tests { let actual_response = parse_request_bytes(request_bytes, mock_callback); assert_eq!(actual_response, expected_response); } -} +} \ No newline at end of file