Use smoltcp constant in results from DNS
This commit is contained in:
parent
ef69f386ab
commit
fd670a9ae5
2 changed files with 10 additions and 2 deletions
|
@ -63,7 +63,11 @@ where
|
|||
}
|
||||
|
||||
/// 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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -494,7 +494,11 @@ impl<D: Driver> Stack<D> {
|
|||
|
||||
/// Make a query for a given name and return the corresponding IP addresses.
|
||||
#[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
|
||||
match qtype {
|
||||
#[cfg(feature = "proto-ipv4")]
|
||||
|
|
Loading…
Reference in a new issue