Skip to content

Commit

Permalink
check any match for address records in conflict handler (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
keepsimple1 authored Jan 11, 2025
1 parent b51f67d commit 4288190
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/service_daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,17 @@ impl Zeroconf {
continue;
}
}

// double check if any other address record matches rrdata,
// as there could be multiple addresses for the same name.
let any_match = probe.records.iter().any(|r| {
r.get_type() == answer.get_type()
&& r.get_class() == answer.get_class()
&& r.rrdata_match(answer.as_ref())
});
if any_match {
continue; // no conflict for this answer.
}
}

probe.records.retain(|record| {
Expand Down

0 comments on commit 4288190

Please sign in to comment.