diff options
author | Leon M. Busch-George <leon@georgemail.eu> | 2023-06-16 14:53:09 +0200 |
---|---|---|
committer | Leon M. Busch-George <leon@georgemail.eu> | 2023-09-25 15:02:49 +0200 |
commit | 9e8bbd4265271612732c0804065ce8bf4939e8c0 (patch) | |
tree | 1521e492c1c080c926b99109e6f61b545563e287 /package/base-files | |
parent | 658549837282d0ca9decfdaf599fc67bf90418c6 (diff) | |
download | openwrt-9e8bbd4265271612732c0804065ce8bf4939e8c0.tar.gz openwrt-9e8bbd4265271612732c0804065ce8bf4939e8c0.tar.bz2 openwrt-9e8bbd4265271612732c0804065ce8bf4939e8c0.zip |
base-files: ipcalc.sh: correctly interpret num parameter
The start and end addresses are inclusive.
Thus, adding num without substracting one results in num + 1 addresses.
Add the substraction and to implement the documented behaviour.
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Diffstat (limited to 'package/base-files')
-rwxr-xr-x | package/base-files/files/bin/ipcalc.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index 56854b4104..21f84bcaf2 100755 --- a/package/base-files/files/bin/ipcalc.sh +++ b/package/base-files/files/bin/ipcalc.sh @@ -69,7 +69,7 @@ BEGIN { if (start<limit) start=limit if (start==ipaddr) start=ipaddr+1 - end=start+ARGV[4] + end=start+ARGV[4]-1 limit=or(network,compl32(netmask))-1 if (end>limit) end=limit if (end==ipaddr) end=ipaddr-1 |