From 1abdc556cb5657b468feee436266f0d7aff28cea Mon Sep 17 00:00:00 2001 From: travis laduke Date: Tue, 14 Mar 2023 15:02:10 -0700 Subject: [PATCH] fix rfc4193 related integration test failures re issue #209 they would fail _sometimes_ so far so good with this change this change inserts fd23:3cca:ac27:8e85:c199:9300::/88 instead of fd23:3cca:ac27:8e85:c199:93e7:50c5:1646/88 into the reverse ptr authority actually it would insert 1 of each before so there would be 2 SOA things, but only 1 would have the actual ptr records on it and then lookups would fail _sometimes_ actually, maybe to_ptr_soa_name should do this The real app init() does a similar thing, so we'll need to address that too. Not sure if this the correct fix yet. --- tests/service/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/service/mod.rs b/tests/service/mod.rs index 800e325..0a7283d 100644 --- a/tests/service/mod.rs +++ b/tests/service/mod.rs @@ -177,11 +177,14 @@ impl Service { let socket_addr = SocketAddr::new(listen_ip.clone(), 53); listen_ips.push(socket_addr); let cidr = IpNetwork::from_str(&cidr.clone()).unwrap(); + let cidr = IpNetwork::new(cidr.network(), cidr.prefix()).unwrap(); + if !ipmap.contains_key(&listen_ip) { ipmap.insert(listen_ip, cidr.network()); } if !authority_map.contains_key(&cidr) { + let cidr = IpNetwork::new(cidr.network(), cidr.prefix()).unwrap(); let ptr_authority = RecordAuthority::new( cidr.to_ptr_soa_name().unwrap(), cidr.to_ptr_soa_name().unwrap(), @@ -195,6 +198,7 @@ impl Service { if let Some(v6assign) = tn.network.config.clone().unwrap().v6_assign_mode { if v6assign.rfc4193.unwrap_or(false) { let cidr = tn.network.clone().rfc4193().unwrap(); + let cidr = IpNetwork::new(cidr.network(), cidr.prefix()).unwrap(); if !authority_map.contains_key(&cidr) { let ptr_authority = RecordAuthority::new( cidr.to_ptr_soa_name().unwrap(),