Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command-executer: Replace deprecated SockAddr with VsockAddr #563

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ do

configure_ne_driver

timeout 5m \
timeout 7m \
./build/nitro_cli/"${ARCH}"-unknown-linux-musl/release/deps/"${test_exec_name}" \
--test-threads=1 --nocapture || test_failed
done < <(grep -v '^ *#' < build/test_executables.txt)
Expand Down
2 changes: 1 addition & 1 deletion samples/command_executer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rust-version = "1.60"
[dependencies]
clap = "3.2"
log = "0.4"
nix = "0.23"
nix = "0.26"
serde = { version = ">=1.0", features = ["derive"] }
serde_json = "1.0"
byteorder = "1.3"
Expand Down
6 changes: 3 additions & 3 deletions samples/command_executer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,7 +56,7 @@ impl AsRawFd for VsockSocket {
}

fn vsock_connect(cid: u32, port: u32) -> Result<VsockSocket, String> {
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 {
Expand Down Expand Up @@ -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))?;

Expand Down