Skip to content

Commit

Permalink
In case of vsock, cloning of the socket is invalid
Browse files Browse the repository at this point in the history
After accepting a connection, the new socket has to use
the same port like the listening stream.

=> Accepting of new connection is not possible.
  • Loading branch information
stlankes committed Aug 8, 2024
1 parent ebf94b7 commit 8b80a6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/syscalls/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,9 @@ pub unsafe extern "C" fn sys_accept(fd: i32, addr: *mut sockaddr, addrlen: *mut
}
#[cfg(feature = "vsock")]
Endpoint::Vsock(endpoint) => {
let new_obj = dyn_clone::clone_box(&*v);
replace_object(fd, Arc::from(new_obj)).unwrap();
let new_fd = insert_object(v).unwrap();
//let new_obj = dyn_clone::clone_box(&*v);
//replace_object(fd, Arc::from(new_obj)).unwrap();
let new_fd = insert_object(v.clone()).unwrap();

if !addr.is_null() && !addrlen.is_null() {
let addrlen = unsafe { &mut *addrlen };
Expand Down

0 comments on commit 8b80a6d

Please sign in to comment.