From 96e18edd190bcbd8072536d2e71fadab850a70e2 Mon Sep 17 00:00:00 2001 From: Jackson Coxson Date: Thu, 23 Jun 2022 23:10:11 -0600 Subject: [PATCH] Invert logic for IP version mismatch --- src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 490d90c..3a22e5d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -238,8 +238,8 @@ impl Config { let endpoint_bind_addr = if let Some(addr) = matches.value_of("endpoint-bind-addr") { let addr = parse_addr(Some(addr)).with_context(|| "Invalid host address")?; // Make sure the host address and endpoint address are the same IP version - if addr.ip().is_ipv6() && endpoint_addr.ip().is_ipv6() - || (addr.ip().is_ipv4() && endpoint_addr.ip().is_ipv4()) + if addr.ip().is_ipv6() != endpoint_addr.ip().is_ipv6() + || (addr.ip().is_ipv4() != endpoint_addr.ip().is_ipv4()) { return Err(anyhow::anyhow!( "Host address and endpoint address must be the same IP version"