[openwrt/openwrt] base-files: fix ipcalc bound calculation for /31 prefix
LEDE Commits
lede-commits at lists.infradead.org
Mon Jun 17 04:48:41 PDT 2024
ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/bff0e1cfd87374ae0994ea57f8b8b8f14d8d9f38
commit bff0e1cfd87374ae0994ea57f8b8b8f14d8d9f38
Author: Leon M. Busch-George <leon at georgemail.eu>
AuthorDate: Thu May 9 11:32:26 2024 +0200
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 at georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/15430
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
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
More information about the lede-commits
mailing list