Skip to content

Commit

Permalink
ip masks can be the same across TLS configs for the same server
Browse files Browse the repository at this point in the history
  • Loading branch information
cfal committed Mar 13, 2022
1 parent 8daf03a commit a80a573
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,10 @@ pub async fn run_tcp_server(

let mut config_lookup_table = IpLookupTable::new();
for (addr, masklen) in allowed_ips.iter() {
if tls_lookup_table
.insert(addr.clone(), *masklen, true)
.is_some()
{
panic!(
"Address {}/{} is duplicated in the TLS config.",
addr, masklen
);
}
// addresses can be the same across different TLS configs
let _ = tls_lookup_table.insert(addr.clone(), *masklen, true);

// .. but shouldn't be duplicated in a single config.
if config_lookup_table
.insert(addr.clone(), *masklen, true)
.is_some()
Expand Down

0 comments on commit a80a573

Please sign in to comment.