From 703b0fcb6100b8565b5ff9f3d8d44ee4baafd739 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Thu, 24 Sep 2026 08:10:19 +0200 Subject: [PATCH] Accept an off-subnet gateway for /31 and /32 --- ui/validate.func | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/validate.func b/ui/validate.func index 983bdd5..39ac0f0 100644 --- a/ui/validate.func +++ b/ui/validate.func @@ -402,6 +402,9 @@ validate_gateway_in_subnet() { local ip="${static_ip%%/*}" local cidr="${static_ip##*/}" + # /31 and /32 have no usable subnet, so an off-subnet gateway is normal there. + ((cidr >= 31)) && return 0 + # Convert CIDR to netmask bits local mask=$((0xFFFFFFFF << (32 - cidr) & 0xFFFFFFFF))