net: StaticV4 config behind proto-ipv4

This commit is contained in:
Ruben De Smet
2023-06-05 16:00:53 +02:00
parent 54bab33c73
commit e871324bde
8 changed files with 47 additions and 16 deletions

View File

@ -88,6 +88,7 @@ where
let addrs = self.query(host, qtype).await?;
if let Some(first) = addrs.get(0) {
Ok(match first {
#[cfg(feature = "proto-ipv4")]
IpAddress::Ipv4(addr) => IpAddr::V4(addr.0.into()),
#[cfg(feature = "proto-ipv6")]
IpAddress::Ipv6(addr) => IpAddr::V6(addr.0.into()),