scope dns operations within a cfged block

This commit is contained in:
Ulf Lilleengen 2023-02-10 19:00:00 +01:00
parent 32c3725631
commit a7d3ef9122
Failed to extract signature

View File

@ -328,9 +328,11 @@ impl<D: Driver + 'static> Inner<D> {
}
#[cfg(feature = "dns")]
let socket = s.sockets.get_mut::<smoltcp::socket::dns::Socket>(self.dns_socket);
let servers: Vec<IpAddress, 3> = config.dns_servers.iter().map(|c| IpAddress::Ipv4(*c)).collect();
socket.update_servers(&servers[..]);
{
let socket = s.sockets.get_mut::<smoltcp::socket::dns::Socket>(self.dns_socket);
let servers: Vec<IpAddress, 3> = config.dns_servers.iter().map(|c| IpAddress::Ipv4(*c)).collect();
socket.update_servers(&servers[..]);
}
self.config = Some(config)
}