From: Leon M. Busch-George Date: Thu, 9 May 2024 09:32:26 +0000 (+0200) Subject: base-files: fix ipcalc bound calculation for /31 prefix X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bff0e1cfd87374ae0994ea57f8b8b8f14d8d9f38;p=openwrt%2Fstaging%2Fxback.git 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 --- 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