Skip to content

Commit

Permalink
improve rfc4193 related integration test failures
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
laduke committed Mar 29, 2023
1 parent 495077f commit faa3e47
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ impl Launcher {
let cidr = IpNetwork::from_str(&cidr.clone())?;
ipmap.entry(listen_ip).or_insert_with(|| cidr.network());

let cidr = IpNetwork::new(cidr.network(), cidr.prefix()).unwrap();

if let Entry::Vacant(e) = authority_map.entry(cidr) {
tracing::debug!("{}", cidr.to_ptr_soa_name()?);
let ptr_authority =
Expand Down
4 changes: 4 additions & 0 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ mod tests {
IpNetwork::from_str("1.2.3.4/32").unwrap(),
LowerName::from_str("4.3.2.1.in-addr.arpa").unwrap(),
),
(
IpNetwork::from_str("fd0c:ccb7:52f7:13c4:7c99:9312:1234:5678/88").unwrap(),
LowerName::from_str("3.9.9.9.c.7.4.c.3.1.7.f.2.5.7.b.c.c.c.0.d.f.ip6.arpa").unwrap(),
)
] {
assert_eq!(item.0.to_ptr_soa_name().unwrap(), item.1);
}
Expand Down
1 change: 1 addition & 0 deletions tests/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ impl Service {
ipmap.insert(listen_ip, cidr.network());
}

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(),
Expand Down

0 comments on commit faa3e47

Please sign in to comment.