diff --git a/rust/Cargo.lock b/rust/Cargo.lock index e912560d8..f4f6b76e9 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2605,8 +2605,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hickory-proto" version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +source = "git+https://github.com/hickory-dns/hickory-dns?rev=a3669bd80f3f7b97f0c301c15f1cba6368d97b63#a3669bd80f3f7b97f0c301c15f1cba6368d97b63" dependencies = [ "async-trait", "cfg-if", @@ -2615,7 +2614,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.4.0", + "idna", "ipnet", "once_cell", "rand 0.8.5", @@ -2629,8 +2628,7 @@ dependencies = [ [[package]] name = "hickory-resolver" version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +source = "git+https://github.com/hickory-dns/hickory-dns?rev=a3669bd80f3f7b97f0c301c15f1cba6368d97b63#a3669bd80f3f7b97f0c301c15f1cba6368d97b63" dependencies = [ "cfg-if", "futures-util", @@ -2903,16 +2901,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.5.0" @@ -6898,7 +6886,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", "serde", ] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 4ec5bc2fa..38c56e6ca 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -25,7 +25,7 @@ backoff = { version = "0.4", features = ["tokio"] } tracing = { version = "0.1.40" } tracing-subscriber = { version = "0.3.17", features = ["parking_lot"] } secrecy = "0.8" -hickory-resolver = { version = "0.24", features = ["tokio-runtime"] } +hickory-resolver = { git = "https://github.com/hickory-dns/hickory-dns", rev="a3669bd80f3f7b97f0c301c15f1cba6368d97b63", features = ["tokio-runtime"] } str0m = { version = "0.4", default-features = false } futures-bounded = "0.2.1" domain = { version = "0.9", features = ["serde"] } diff --git a/rust/connlib/tunnel/src/dns.rs b/rust/connlib/tunnel/src/dns.rs index f21530a13..4d8146e69 100644 --- a/rust/connlib/tunnel/src/dns.rs +++ b/rust/connlib/tunnel/src/dns.rs @@ -9,6 +9,7 @@ use domain::base::{ Message, MessageBuilder, Question, ToDname, }; use hickory_resolver::lookup::Lookup; +use hickory_resolver::proto::error::{ProtoError, ProtoErrorKind}; use hickory_resolver::proto::op::{Message as TrustDnsMessage, MessageType}; use hickory_resolver::proto::rr::RecordType; use itertools::Itertools; @@ -166,11 +167,15 @@ pub(crate) fn build_response_from_resolve_result( let response = match response.map_err(|err| err.kind().clone()) { Ok(response) => message.add_answers(response.records().to_vec()), - Err(hickory_resolver::error::ResolveErrorKind::NoRecordsFound { - soa, - response_code, - .. - }) => { + Err(hickory_resolver::error::ResolveErrorKind::Proto(ProtoError { kind, .. })) + if matches!(*kind, ProtoErrorKind::NoRecordsFound { .. }) => + { + let ProtoErrorKind::NoRecordsFound { + soa, response_code, .. + } = *kind + else { + panic!("Impossible - We matched on `ProtoErrorKind::NoRecordsFound` but then could not destructure that same variant"); + }; if let Some(soa) = soa { message.add_name_server(soa.clone().into_record_of_rdata()); }