diff --git a/embassy-net/src/dns.rs b/embassy-net/src/dns.rs index 1815d258f..9b1b936c4 100644 --- a/embassy-net/src/dns.rs +++ b/embassy-net/src/dns.rs @@ -1,6 +1,6 @@ //! DNS socket with async support. use heapless::Vec; -pub use smoltcp::socket::dns::{DnsQuery, Socket, MAX_ADDRESS_COUNT}; +pub use smoltcp::socket::dns::{DnsQuery, Socket}; pub(crate) use smoltcp::socket::dns::{GetQueryResultError, StartQueryError}; pub use smoltcp::wire::{DnsQueryType, IpAddress}; @@ -48,9 +48,7 @@ impl<'a, D> DnsSocket<'a, D> where D: Driver + 'static, { - /// Create a new DNS socket using the provided stack and query storage. - /// - /// DNS servers are derived from the stack configuration. + /// Create a new DNS socket using the provided stack. /// /// NOTE: If using DHCP, make sure it has reconfigured the stack to ensure the DNS servers are updated. pub fn new(stack: &'a Stack) -> Self { @@ -58,7 +56,7 @@ where } /// Make a query for a given name and return the corresponding IP addresses. - pub async fn query(&self, name: &str, qtype: DnsQueryType) -> Result, Error> { + pub async fn query(&self, name: &str, qtype: DnsQueryType) -> Result, Error> { self.stack.dns_query(name, qtype).await } } diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index b63aa83df..5b6ab0e3a 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs @@ -231,12 +231,9 @@ impl Stack { unreachable!() } + /// Make a query for a given name and return the corresponding IP addresses. #[cfg(feature = "dns")] - async fn dns_query( - &self, - name: &str, - qtype: dns::DnsQueryType, - ) -> Result, dns::Error> { + pub async fn dns_query(&self, name: &str, qtype: dns::DnsQueryType) -> Result, dns::Error> { let query = self.with_mut(|s, i| { if let Some(dns_handle) = i.dns_socket { let socket = s.sockets.get_mut::(dns_handle);