Use constant Ipv4Addr::LOCALHOST
This commit is contained in:
parent
65eeae374c
commit
6d54a6a5d1
2 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ fn handle_connect(
|
|||
_: &str,
|
||||
socket_addr: Option<SocketAddr>,
|
||||
) -> milter::Result<Status> {
|
||||
let ip = socket_addr.map_or_else(|| IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), |a| a.ip());
|
||||
let ip = socket_addr.map_or_else(|| IpAddr::V4(Ipv4Addr::LOCALHOST), |a| a.ip());
|
||||
|
||||
if config::get().use_trusted_networks() {
|
||||
if config::get().is_in_trusted_networks(&ip) {
|
||||
|
|
|
@ -19,7 +19,7 @@ pub fn spawn_mock_spamd_server<F>(port: u16, f: F) -> JoinHandle<()>
|
|||
where
|
||||
F: Fn(String) -> HamOrSpam + Send + 'static,
|
||||
{
|
||||
let socket_addr = SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), port);
|
||||
let socket_addr = SocketAddrV4::new(Ipv4Addr::LOCALHOST, port);
|
||||
let timeout = Duration::from_secs(15);
|
||||
|
||||
thread::spawn(move || {
|
||||
|
|
Loading…
Reference in a new issue