diff --git a/Shorewall-lite/shorewall-lite b/Shorewall-lite/shorewall-lite index b41faedaf..b30e081df 100755 --- a/Shorewall-lite/shorewall-lite +++ b/Shorewall-lite/shorewall-lite @@ -755,7 +755,8 @@ case "$COMMAND" in usage 1 fi - [ -z "$vlsm" ] && exit 2 + valid_address $address || fatal_error "Invalid IP address: $address" + if [ -z "$vlsm" ] && exit 2 [ "x$address" = "x$vlsm" ] && usage 2 [ $vlsm -gt 32 ] && echo "Invalid VLSM: /$vlsm" >&2 && exit 2 @@ -771,6 +772,10 @@ case "$COMMAND" in [ -n "$debugging" ] && set -x case $2 in *.*.*.*-*.*.*.*) + for address in ${2%-*} ${2#*-}; do + valid_address $address || fatal_error "Invalid IP address: $address" + done + ip_range $2 ;; *) @@ -782,6 +787,7 @@ case "$COMMAND" in [ -n "$debugging" ] && set -x case $2 in *.*.*.*) + valid_address $2 || fatal_error "Invalid IP address: $2" echo " $(decodeaddr $2)" ;; *)