[networking-fixes] add option to bind outgoing RPC sockets (fix #638)

Thanks to yuka for the original patch.
This commit is contained in:
Alex Auvolat
2024-02-19 11:24:33 +01:00
parent f0bbad2db9
commit b96f84b894
5 changed files with 31 additions and 7 deletions
+4 -1
View File
@@ -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);