mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-18 16:32:17 +00:00
fix(build): allow /31 and /32 CIDR with out-of-subnet gateway (#13231)
This commit is contained in:
committed by
GitHub
parent
7ed27dcdb8
commit
f29606ae87
@@ -529,6 +529,10 @@ validate_gateway_in_subnet() {
|
|||||||
local ip="${static_ip%%/*}"
|
local ip="${static_ip%%/*}"
|
||||||
local cidr="${static_ip##*/}"
|
local cidr="${static_ip##*/}"
|
||||||
|
|
||||||
|
# /31 and /32 are valid point-to-point / zero-trust DMZ configurations
|
||||||
|
# where the gateway is technically outside the subnet — skip validation
|
||||||
|
((cidr >= 31)) && return 0
|
||||||
|
|
||||||
# Convert CIDR to netmask bits
|
# Convert CIDR to netmask bits
|
||||||
local mask=$((0xFFFFFFFF << (32 - cidr) & 0xFFFFFFFF))
|
local mask=$((0xFFFFFFFF << (32 - cidr) & 0xFFFFFFFF))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user