From 1a660880146fa209ec2e9ef84f91c697aebc49c6 Mon Sep 17 00:00:00 2001 From: Andrew Yao Date: Mon, 6 May 2024 21:30:26 -0500 Subject: [PATCH] Reduce test verbosity in arp.rs Signed-off-by: Andrew Yao Co-authored-by: Himanshu Reddy Co-authored-by: Goldin Vo --- src/vmm/src/dumbo/tcp/endpoint.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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