diff --git a/veilid-core/src/network_manager/connection_manager.rs b/veilid-core/src/network_manager/connection_manager.rs index 1496aae0..cf6744ef 100644 --- a/veilid-core/src/network_manager/connection_manager.rs +++ b/veilid-core/src/network_manager/connection_manager.rs @@ -63,12 +63,13 @@ impl ConnectionManager { c.network.connection_inactivity_timeout_ms, ) }; + let address_filter = network_manager.address_filter(); ConnectionManagerArc { network_manager, connection_initial_timeout_ms, connection_inactivity_timeout_ms, - connection_table: ConnectionTable::new(config), + connection_table: ConnectionTable::new(config, address_filter), address_lock_table: AsyncTagLockTable::new(), inner: Mutex::new(None), } diff --git a/veilid-core/src/network_manager/connection_table.rs b/veilid-core/src/network_manager/connection_table.rs index 6ca9b210..3e8f11e8 100644 --- a/veilid-core/src/network_manager/connection_table.rs +++ b/veilid-core/src/network_manager/connection_table.rs @@ -38,7 +38,7 @@ pub struct ConnectionTable { } impl ConnectionTable { - pub fn new(config: VeilidConfig) -> Self { + pub fn new(config: VeilidConfig, address_filter: AddressFilter) -> Self { let max_connections = { let c = config.get(); vec![ @@ -58,7 +58,7 @@ impl ConnectionTable { protocol_index_by_id: BTreeMap::new(), id_by_descriptor: BTreeMap::new(), ids_by_remote: BTreeMap::new(), - address_filter: AddressFilter::new(config), + address_filter, })), } } diff --git a/veilid-core/src/network_manager/tests/test_connection_table.rs b/veilid-core/src/network_manager/tests/test_connection_table.rs index 8a48c79d..5a52cd46 100644 --- a/veilid-core/src/network_manager/tests/test_connection_table.rs +++ b/veilid-core/src/network_manager/tests/test_connection_table.rs @@ -5,8 +5,8 @@ use crate::tests::common::test_veilid_config::*; pub async fn test_add_get_remove() { let config = get_config(); - - let table = ConnectionTable::new(config); + let address_filter = AddressFilter::new(config.clone()); + let table = ConnectionTable::new(config, address_filter); let a1 = ConnectionDescriptor::new_no_local(PeerAddress::new( SocketAddress::new(Address::IPV4(Ipv4Addr::new(192, 168, 0, 1)), 8080),