mirror of https://github.com/hak5/openwrt-owl.git
base-files: ipcalc.sh: support bit length as netmask parameter
SVN-Revision: 39100owl
parent
fe230cac18
commit
ef0ce72b39
|
@ -31,6 +31,10 @@ BEGIN {
|
||||||
slpos=index(ARGV[1],"/")
|
slpos=index(ARGV[1],"/")
|
||||||
if (slpos == 0) {
|
if (slpos == 0) {
|
||||||
ipaddr=ip2int(ARGV[1])
|
ipaddr=ip2int(ARGV[1])
|
||||||
|
dotpos=index(ARGV[2],".")
|
||||||
|
if (dotpos == 0)
|
||||||
|
netmask=compl32(2**(32-int(ARGV[2]))-1)
|
||||||
|
else
|
||||||
netmask=ip2int(ARGV[2])
|
netmask=ip2int(ARGV[2])
|
||||||
} else {
|
} else {
|
||||||
ipaddr=ip2int(substr(ARGV[1],0,slpos-1))
|
ipaddr=ip2int(substr(ARGV[1],0,slpos-1))
|
||||||
|
|
Loading…
Reference in New Issue