don't care about question type when overriding records
* Even if the client wants A records, respond with AAAA anyway and vice-versa. Otherwise, our resolving client will fall back to upstream.
This commit is contained in:
parent
af31c53072
commit
d68ad0971e
|
@ -79,22 +79,16 @@ impl OverrideResolver {
|
||||||
IpAddr::V6(addr) => (Rtype::Aaaa, AllRecordData::Aaaa(Aaaa::new(addr.clone()))),
|
IpAddr::V6(addr) => (Rtype::Aaaa, AllRecordData::Aaaa(Aaaa::new(addr.clone()))),
|
||||||
};
|
};
|
||||||
|
|
||||||
let qtype = question.qtype();
|
// Convert AllRecordData to UnknownRecordData to match the type
|
||||||
if qtype == Rtype::Any || qtype == rtype {
|
// since our resolver client doesn't really care about the actual type
|
||||||
// Convert AllRecordData to UnknownRecordData to match the type
|
let mut rdata_buf: Vec<u8> = Vec::new();
|
||||||
// since our resolver client doesn't really care about the actual type
|
rdata.compose(&mut rdata_buf).ok()?;
|
||||||
let mut rdata_buf: Vec<u8> = Vec::new();
|
let record = Record::new(
|
||||||
rdata.compose(&mut rdata_buf).ok()?;
|
question.qname().clone(),
|
||||||
let record = Record::new(
|
question.qclass(),
|
||||||
question.qname().clone(),
|
self.override_ttl,
|
||||||
question.qclass(),
|
UnknownRecordData::from_octets(rtype, rdata_buf),
|
||||||
self.override_ttl,
|
);
|
||||||
UnknownRecordData::from_octets(rtype, rdata_buf),
|
return Some(record);
|
||||||
);
|
|
||||||
return Some(record);
|
|
||||||
} else {
|
|
||||||
// If the response and query types don't match, just return none
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue