mirror of
https://github.com/aramperes/onetun.git
synced 2025-09-09 06:58:31 -04:00
Invert logic for IP version mismatch
This commit is contained in:
parent
c647bc9a96
commit
96e18edd19
1 changed files with 2 additions and 2 deletions
|
@ -238,8 +238,8 @@ impl Config {
|
||||||
let endpoint_bind_addr = if let Some(addr) = matches.value_of("endpoint-bind-addr") {
|
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")?;
|
let addr = parse_addr(Some(addr)).with_context(|| "Invalid host address")?;
|
||||||
// Make sure the host address and endpoint address are the same IP version
|
// Make sure the host address and endpoint address are the same IP version
|
||||||
if addr.ip().is_ipv6() && endpoint_addr.ip().is_ipv6()
|
if addr.ip().is_ipv6() != endpoint_addr.ip().is_ipv6()
|
||||||
|| (addr.ip().is_ipv4() && endpoint_addr.ip().is_ipv4())
|
|| (addr.ip().is_ipv4() != endpoint_addr.ip().is_ipv4())
|
||||||
{
|
{
|
||||||
return Err(anyhow::anyhow!(
|
return Err(anyhow::anyhow!(
|
||||||
"Host address and endpoint address must be the same IP version"
|
"Host address and endpoint address must be the same IP version"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue