diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index 21f84bcaf2e..c852b5163f4 100755 --- a/package/base-files/files/bin/ipcalc.sh +++ b/package/base-files/files/bin/ipcalc.sh @@ -64,13 +64,21 @@ BEGIN { if (ARGC <= 3) exit(0) + if (prefix<=30) + limit=network+1 + else + limit=network + start=or(network,and(ip2int(ARGV[3]),compl32(netmask))) - limit=network+1 if (startlimit) end=limit if (end==ipaddr) end=ipaddr-1