Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/dns_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,22 @@ impl DnsOutgoing {
self.questions.push(q);
}

/// Clear the cache-flush (unique) bit on every answer and additional
/// record. Required for RFC 6762 §6.7 (Legacy Unicast Responses) and
/// §10.2 — a legacy resolver doesn't know about the cache-flush bit
/// and may misinterpret responses where it is set.
pub fn clear_cache_flush_bits(&mut self) {
for (rec, _) in &mut self.answers {
rec.get_record_mut().entry.cache_flush = false;
}
for rec in &mut self.additionals {
rec.get_record_mut().entry.cache_flush = false;
}
for rec in &mut self.authorities {
rec.get_record_mut().entry.cache_flush = false;
}
}

/// Returns a list of actual DNS packet data to be sent on the wire.
pub fn to_data_on_wire(&self) -> Vec<Vec<u8>> {
let packet_list = self.to_packets();
Expand Down
Loading
Loading