diff options
| author | Emil Fresk <[email protected]> | 2023-11-14 08:31:02 +0100 |
|---|---|---|
| committer | Emil Fresk <[email protected]> | 2023-11-14 08:50:51 +0100 |
| commit | fd670a9ae527b534293eb692273285d7a1221cdd (patch) | |
| tree | 828578d6896521734c6c531d291efb09b3b0310d | |
| parent | ef69f386ab1c44c2e2813f8bf934e7440e09852a (diff) | |
Use smoltcp constant in results from DNS
| -rw-r--r-- | embassy-net/src/dns.rs | 6 | ||||
| -rw-r--r-- | embassy-net/src/lib.rs | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/embassy-net/src/dns.rs b/embassy-net/src/dns.rs index 6b804f9ed..69fc5cdf1 100644 --- a/embassy-net/src/dns.rs +++ b/embassy-net/src/dns.rs | |||
| @@ -63,7 +63,11 @@ where | |||
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | /// Make a query for a given name and return the corresponding IP addresses. | 65 | /// Make a query for a given name and return the corresponding IP addresses. |
| 66 | pub async fn query(&self, name: &str, qtype: DnsQueryType) -> Result<Vec<IpAddress, 1>, Error> { | 66 | pub async fn query( |
| 67 | &self, | ||
| 68 | name: &str, | ||
| 69 | qtype: DnsQueryType, | ||
| 70 | ) -> Result<Vec<IpAddress, { smoltcp::config::DNS_MAX_RESULT_COUNT }>, Error> { | ||
| 67 | self.stack.dns_query(name, qtype).await | 71 | self.stack.dns_query(name, qtype).await |
| 68 | } | 72 | } |
| 69 | } | 73 | } |
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index b9315079a..6aa476aa0 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs | |||
| @@ -494,7 +494,11 @@ impl<D: Driver> Stack<D> { | |||
| 494 | 494 | ||
| 495 | /// Make a query for a given name and return the corresponding IP addresses. | 495 | /// Make a query for a given name and return the corresponding IP addresses. |
| 496 | #[cfg(feature = "dns")] | 496 | #[cfg(feature = "dns")] |
| 497 | pub async fn dns_query(&self, name: &str, qtype: dns::DnsQueryType) -> Result<Vec<IpAddress, 1>, dns::Error> { | 497 | pub async fn dns_query( |
| 498 | &self, | ||
| 499 | name: &str, | ||
| 500 | qtype: dns::DnsQueryType, | ||
| 501 | ) -> Result<Vec<IpAddress, { smoltcp::config::DNS_MAX_RESULT_COUNT }>, dns::Error> { | ||
| 498 | // For A and AAAA queries we try detect whether `name` is just an IP address | 502 | // For A and AAAA queries we try detect whether `name` is just an IP address |
| 499 | match qtype { | 503 | match qtype { |
| 500 | #[cfg(feature = "proto-ipv4")] | 504 | #[cfg(feature = "proto-ipv4")] |
