diff options
Diffstat (limited to 'embassy-net/src/dns.rs')
| -rw-r--r-- | embassy-net/src/dns.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/embassy-net/src/dns.rs b/embassy-net/src/dns.rs index 1fbaea4f0..dbe73776c 100644 --- a/embassy-net/src/dns.rs +++ b/embassy-net/src/dns.rs | |||
| @@ -73,8 +73,11 @@ impl<'a> embedded_nal_async::Dns for DnsSocket<'a> { | |||
| 73 | &self, | 73 | &self, |
| 74 | host: &str, | 74 | host: &str, |
| 75 | addr_type: embedded_nal_async::AddrType, | 75 | addr_type: embedded_nal_async::AddrType, |
| 76 | ) -> Result<embedded_nal_async::IpAddr, Self::Error> { | 76 | ) -> Result<core::net::IpAddr, Self::Error> { |
| 77 | use embedded_nal_async::{AddrType, IpAddr}; | 77 | use core::net::IpAddr; |
| 78 | |||
| 79 | use embedded_nal_async::AddrType; | ||
| 80 | |||
| 78 | let (qtype, secondary_qtype) = match addr_type { | 81 | let (qtype, secondary_qtype) = match addr_type { |
| 79 | AddrType::IPv4 => (DnsQueryType::A, None), | 82 | AddrType::IPv4 => (DnsQueryType::A, None), |
| 80 | AddrType::IPv6 => (DnsQueryType::Aaaa, None), | 83 | AddrType::IPv6 => (DnsQueryType::Aaaa, None), |
| @@ -98,20 +101,16 @@ impl<'a> embedded_nal_async::Dns for DnsSocket<'a> { | |||
| 98 | if let Some(first) = addrs.get(0) { | 101 | if let Some(first) = addrs.get(0) { |
| 99 | Ok(match first { | 102 | Ok(match first { |
| 100 | #[cfg(feature = "proto-ipv4")] | 103 | #[cfg(feature = "proto-ipv4")] |
| 101 | IpAddress::Ipv4(addr) => IpAddr::V4(addr.0.into()), | 104 | IpAddress::Ipv4(addr) => IpAddr::V4(*addr), |
| 102 | #[cfg(feature = "proto-ipv6")] | 105 | #[cfg(feature = "proto-ipv6")] |
| 103 | IpAddress::Ipv6(addr) => IpAddr::V6(addr.0.into()), | 106 | IpAddress::Ipv6(addr) => IpAddr::V6(*addr), |
| 104 | }) | 107 | }) |
| 105 | } else { | 108 | } else { |
| 106 | Err(Error::Failed) | 109 | Err(Error::Failed) |
| 107 | } | 110 | } |
| 108 | } | 111 | } |
| 109 | 112 | ||
| 110 | async fn get_host_by_address( | 113 | async fn get_host_by_address(&self, _addr: core::net::IpAddr, _result: &mut [u8]) -> Result<usize, Self::Error> { |
| 111 | &self, | ||
| 112 | _addr: embedded_nal_async::IpAddr, | ||
| 113 | _result: &mut [u8], | ||
| 114 | ) -> Result<usize, Self::Error> { | ||
| 115 | todo!() | 114 | todo!() |
| 116 | } | 115 | } |
| 117 | } | 116 | } |
