Fix adding range of aliases

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@732 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep
2003-08-27 15:13:03 +00:00
parent 3550dbc3e5
commit afbe79977e
6 changed files with 36 additions and 5 deletions

View File

@ -308,6 +308,33 @@ ip_range() {
done
}
ip_range_explicit() {
local first last
case $1 in
[0-9]*.*.*.*-*.*.*.*)
;;
*)
echo $1
return
;;
esac
first=`decodeaddr ${1%-*}`
last=`decodeaddr ${1#*-}`
if [ $first -gt $last ]; then
fatal_error "Invalid IP address range: $1"
fi
l=$(( $last + 1 ))
while [ $first -le $last ]; do
echo `encodeaddr $first`
first=$(($first + 1))
done
}
#
# Netmask from CIDR
#