From d9033e2843d105a5cc375d64a74049008df9e1e2 Mon Sep 17 00:00:00 2001 From: Costin Lupu Date: Thu, 7 Dec 2023 15:03:44 +0100 Subject: [PATCH] command-executer: Replace deprecated SockAddr with VsockAddr Currently the `run_describe_terminate_command_executer_docker_image` test fails when using the deprecated SockAddr dependency because the console output of the enclave under test is not entirely captured. Fortunately, switching to VsockAddr fixes that. Signed-off-by: Costin Lupu --- samples/command_executer/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/command_executer/src/lib.rs b/samples/command_executer/src/lib.rs index 92791b277..1c9e79630 100644 --- a/samples/command_executer/src/lib.rs +++ b/samples/command_executer/src/lib.rs @@ -7,7 +7,7 @@ use protocol_helpers::{recv_loop, recv_u64, send_loop, send_u64}; use nix::sys::socket::listen as listen_vsock; use nix::sys::socket::{accept, bind, connect, shutdown, socket}; -use nix::sys::socket::{AddressFamily, Shutdown, SockAddr, SockFlag, SockType}; +use nix::sys::socket::{AddressFamily, Shutdown, VsockAddr, SockFlag, SockType}; use nix::unistd::close; use num_derive::FromPrimitive; use num_traits::FromPrimitive; @@ -56,7 +56,7 @@ impl AsRawFd for VsockSocket { } fn vsock_connect(cid: u32, port: u32) -> Result { - let sockaddr = SockAddr::new_vsock(cid, port); + let sockaddr = VsockAddr::new(cid, port); let mut err_msg = String::new(); for i in 0..MAX_CONNECTION_ATTEMPTS { @@ -197,7 +197,7 @@ pub fn listen(args: ListenArgs) -> Result<(), String> { ) .map_err(|err| format!("Create socket failed: {:?}", err))?; - let sockaddr = SockAddr::new_vsock(VMADDR_CID_ANY, args.port); + let sockaddr = VsockAddr::new(VMADDR_CID_ANY, args.port); bind(socket_fd, &sockaddr).map_err(|err| format!("Bind failed: {:?}", err))?;