Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade trust-dns-resolver and friends #24108

Merged
merged 3 commits into from
Jun 5, 2024
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
116 changes: 80 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ext/net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ rustls-tokio-stream.workspace = true
serde.workspace = true
socket2.workspace = true
tokio.workspace = true
trust-dns-proto = "0.22"
trust-dns-resolver = { version = "0.22", features = ["tokio-runtime", "serde-config"] }
trust-dns-proto = "0.23"
trust-dns-resolver = { version = "0.23", features = ["tokio-runtime", "serde-config"] }
20 changes: 13 additions & 7 deletions ext/net/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ where
}
}

let resolver = AsyncResolver::tokio(config, opts)?;
let resolver = AsyncResolver::tokio(config, opts);

let lookup_fut = resolver.lookup(query, record_type);

Expand Down Expand Up @@ -781,9 +781,15 @@ mod tests {
use std::path::Path;
use std::sync::Arc;
use std::sync::Mutex;
use trust_dns_proto::rr::rdata::a::A;
use trust_dns_proto::rr::rdata::aaaa::AAAA;
use trust_dns_proto::rr::rdata::caa::KeyValue;
use trust_dns_proto::rr::rdata::caa::CAA;
use trust_dns_proto::rr::rdata::mx::MX;
use trust_dns_proto::rr::rdata::name::ANAME;
use trust_dns_proto::rr::rdata::name::CNAME;
use trust_dns_proto::rr::rdata::name::NS;
use trust_dns_proto::rr::rdata::name::PTR;
use trust_dns_proto::rr::rdata::naptr::NAPTR;
use trust_dns_proto::rr::rdata::srv::SRV;
use trust_dns_proto::rr::rdata::txt::TXT;
Expand All @@ -794,7 +800,7 @@ mod tests {
#[test]
fn rdata_to_return_record_a() {
let func = rdata_to_return_record(RecordType::A);
let rdata = RData::A(Ipv4Addr::new(127, 0, 0, 1));
let rdata = RData::A(A(Ipv4Addr::new(127, 0, 0, 1)));
assert_eq!(
func(&rdata).unwrap(),
Some(DnsReturnRecord::A("127.0.0.1".to_string()))
Expand All @@ -804,7 +810,7 @@ mod tests {
#[test]
fn rdata_to_return_record_aaaa() {
let func = rdata_to_return_record(RecordType::AAAA);
let rdata = RData::AAAA(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
let rdata = RData::AAAA(AAAA(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)));
assert_eq!(
func(&rdata).unwrap(),
Some(DnsReturnRecord::Aaaa("::1".to_string()))
Expand All @@ -814,7 +820,7 @@ mod tests {
#[test]
fn rdata_to_return_record_aname() {
let func = rdata_to_return_record(RecordType::ANAME);
let rdata = RData::ANAME(Name::new());
let rdata = RData::ANAME(ANAME(Name::new()));
assert_eq!(
func(&rdata).unwrap(),
Some(DnsReturnRecord::Aname("".to_string()))
Expand Down Expand Up @@ -842,7 +848,7 @@ mod tests {
#[test]
fn rdata_to_return_record_cname() {
let func = rdata_to_return_record(RecordType::CNAME);
let rdata = RData::CNAME(Name::new());
let rdata = RData::CNAME(CNAME(Name::new()));
assert_eq!(
func(&rdata).unwrap(),
Some(DnsReturnRecord::Cname("".to_string()))
Expand Down Expand Up @@ -889,7 +895,7 @@ mod tests {
#[test]
fn rdata_to_return_record_ns() {
let func = rdata_to_return_record(RecordType::NS);
let rdata = RData::NS(Name::new());
let rdata = RData::NS(NS(Name::new()));
assert_eq!(
func(&rdata).unwrap(),
Some(DnsReturnRecord::Ns("".to_string()))
Expand All @@ -899,7 +905,7 @@ mod tests {
#[test]
fn rdata_to_return_record_ptr() {
let func = rdata_to_return_record(RecordType::PTR);
let rdata = RData::PTR(Name::new());
let rdata = RData::PTR(PTR(Name::new()));
assert_eq!(
func(&rdata).unwrap(),
Some(DnsReturnRecord::Ptr("".to_string()))
Expand Down
4 changes: 2 additions & 2 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ serde.workspace = true
test_util.workspace = true
tokio.workspace = true
tower-lsp.workspace = true
trust-dns-client = "=0.22.0"
trust-dns-server = "=0.22.1"
trust-dns-client = "=0.23.2"
trust-dns-server = "=0.23.2"
url.workspace = true
uuid = { workspace = true, features = ["serde"] }
zeromq.workspace = true
Expand Down
7 changes: 2 additions & 5 deletions tests/integration/run_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4011,11 +4011,8 @@ async fn test_resolve_dns() {
)
.unwrap();
let lexer = Lexer::new(&zone_file);
let records = Parser::new().parse(
lexer,
Some(Name::from_str("example.com").unwrap()),
None,
);
let records =
Parser::new().parse(lexer, Some(Name::from_str("example.com").unwrap()));
if records.is_err() {
panic!("failed to parse: {:?}", records.err())
}
Expand Down