Use smoltcp constant in results from DNS

This commit is contained in:
Emil Fresk 2023-11-14 08:31:02 +01:00
parent ef69f386ab
commit fd670a9ae5
2 changed files with 10 additions and 2 deletions

View file

@ -63,7 +63,11 @@ where
} }
/// Make a query for a given name and return the corresponding IP addresses. /// Make a query for a given name and return the corresponding IP addresses.
pub async fn query(&self, name: &str, qtype: DnsQueryType) -> Result<Vec<IpAddress, 1>, Error> { pub async fn query(
&self,
name: &str,
qtype: DnsQueryType,
) -> Result<Vec<IpAddress, { smoltcp::config::DNS_MAX_RESULT_COUNT }>, Error> {
self.stack.dns_query(name, qtype).await self.stack.dns_query(name, qtype).await
} }
} }

View file

@ -494,7 +494,11 @@ impl<D: Driver> Stack<D> {
/// Make a query for a given name and return the corresponding IP addresses. /// Make a query for a given name and return the corresponding IP addresses.
#[cfg(feature = "dns")] #[cfg(feature = "dns")]
pub async fn dns_query(&self, name: &str, qtype: dns::DnsQueryType) -> Result<Vec<IpAddress, 1>, dns::Error> { pub async fn dns_query(
&self,
name: &str,
qtype: dns::DnsQueryType,
) -> Result<Vec<IpAddress, { smoltcp::config::DNS_MAX_RESULT_COUNT }>, dns::Error> {
// For A and AAAA queries we try detect whether `name` is just an IP address // For A and AAAA queries we try detect whether `name` is just an IP address
match qtype { match qtype {
#[cfg(feature = "proto-ipv4")] #[cfg(feature = "proto-ipv4")]