From b96f84b894684ed43e281a3aa2f391b424414a84 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 19 Feb 2024 11:24:33 +0100 Subject: [networking-fixes] add option to bind outgoing RPC sockets (fix #638) Thanks to yuka for the original patch. --- src/rpc/system.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/rpc') diff --git a/src/rpc/system.rs b/src/rpc/system.rs index 5c6e07b1..147ec4d6 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -324,7 +324,10 @@ impl System { warn!("This Garage node does not know its publicly reachable RPC address, this might hamper intra-cluster communication."); } - let netapp = NetApp::new(GARAGE_VERSION_TAG, network_key, node_key); + let bind_outgoing_to = Some(config) + .filter(|x| x.rpc_bind_outgoing) + .map(|x| x.rpc_bind_addr.ip()); + let netapp = NetApp::new(GARAGE_VERSION_TAG, network_key, node_key, bind_outgoing_to); let peering = PeeringManager::new(netapp.clone(), vec![], rpc_public_addr); if let Some(ping_timeout) = config.rpc_ping_timeout_msec { peering.set_ping_timeout_millis(ping_timeout); -- cgit v1.2.3