Skip to content

Commit 37a5edf

Browse files
committed
Record address instead of only port when binding to an address
1 parent f4a951f commit 37a5edf

File tree

2 files changed

+4
-4
lines changed
  • fortanix-vme

2 files changed

+4
-4
lines changed

fortanix-vme/fortanix-vme-abi/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ pub enum Response {
7272
peer: Addr,
7373
},
7474
Bound {
75-
/// The TCP port the parent VM is listening on
76-
port: u16,
75+
/// The local TCP address the parent VM is listening on
76+
local: Addr,
7777
/// The id used to identify the listener. It can be used for subsequent calls (e.g., to
7878
/// accept new incoming connections)
7979
fd: i32,

fortanix-vme/fortanix-vme-runner/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ impl Server {
245245
fn handle_request_bind(&self, addr: &String, enclave_port: u32, enclave: &mut VsockStream) -> Result<(), IoError> {
246246
let cid: u32 = enclave.peer().unwrap().parse().unwrap_or(vsock::VMADDR_CID_HYPERVISOR);
247247
let listener = TcpListener::bind(addr)?;
248-
let port = listener.local_addr().map(|addr| addr.port())?;
248+
let local = listener.local_addr()?.into();
249249
let fd = self.add_listener_info(ListenerInfo{ listener, enclave_cid: cid, enclave_port });
250-
let response = Response::Bound{ port, fd };
250+
let response = Response::Bound{ local, fd };
251251
Self::log_communication(
252252
"runner",
253253
enclave.local_port().unwrap_or_default(),

0 commit comments

Comments
 (0)