From bff0e1cfd87374ae0994ea57f8b8b8f14d8d9f38 Mon Sep 17 00:00:00 2001 From: "Leon M. Busch-George" Date: Thu, 9 May 2024 11:32:26 +0200 Subject: [PATCH] base-files: fix ipcalc bound calculation for /31 prefix A small regress from the translation to shell. Fixes #12921, originally fixed in #12925 (Github). Signed-off-by: Leon M. Busch-George Link: https://github.com/openwrt/openwrt/pull/15430 Signed-off-by: Christian Marangi --- package/base-files/files/bin/ipcalc.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index 9e2702c60d..ae7a5c9598 100755 --- a/package/base-files/files/bin/ipcalc.sh +++ b/package/base-files/files/bin/ipcalc.sh @@ -111,6 +111,8 @@ start=$((network | (start & hostmask))) if [ "$prefix" -le 30 ]; then upper=$(((network | hostmask) - 1)) +elif [ "$prefix" -eq 31 ]; then + upper=$((network | hostmask)) else upper="$network" fi -- 2.30.2