diff options
author | Alex Auvolat <alex@adnab.me> | 2024-02-19 11:24:33 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2024-02-19 11:45:44 +0100 |
commit | b96f84b894684ed43e281a3aa2f391b424414a84 (patch) | |
tree | a55cb8b6f3306acbd3bd1a90add88e33405680fc /src/rpc | |
parent | f0bbad2db95b00ec429f498fe15f1007bd87da5e (diff) | |
download | garage-b96f84b894684ed43e281a3aa2f391b424414a84.tar.gz garage-b96f84b894684ed43e281a3aa2f391b424414a84.zip |
[networking-fixes] add option to bind outgoing RPC sockets (fix #638)
Thanks to yuka for the original patch.
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/system.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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); |