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 <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/15430
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Leon M. Busch-George 2024-05-09 11:32:26 +02:00 committed by Christian Marangi
parent a5c095c453
commit bff0e1cfd8
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
1 changed files with 2 additions and 0 deletions

View File

@ -111,6 +111,8 @@ start=$((network | (start & hostmask)))
if [ "$prefix" -le 30 ]; then if [ "$prefix" -le 30 ]; then
upper=$(((network | hostmask) - 1)) upper=$(((network | hostmask) - 1))
elif [ "$prefix" -eq 31 ]; then
upper=$((network | hostmask))
else else
upper="$network" upper="$network"
fi fi