File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -502,9 +502,18 @@ is_alias_format_valid() {
502502is_ip_format_valid () {
503503 object_name=${2-ip}
504504 ip_regex=' ([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])'
505- if ! [[ $1 =~ ^$ip_regex \. $ip_regex \. $ip_regex \. $ip_regex $ ]]; then
505+ ip_clean=$( echo " ${1%/ [0-9][0-9]} " )
506+ ip_clean=$( echo " ${1%/ [0-9]} " )
507+ if ! [[ $ip_clean =~ ^$ip_regex \. $ip_regex \. $ip_regex \. $ip_regex $ ]]; then
506508 check_result $E_INVALID " invalid $object_name format :: $1 "
507509 fi
510+ if [ $1 != " $ip_clean " ]; then
511+ ip_cidr=" $ip_clean /"
512+ ip_cidr=$( echo " ${1# $ip_cidr } " )
513+ if [[ " $ip_cidr " -gt 32 ]]; then
514+ check_result $E_INVALID " invalid $object_name format :: $1 "
515+ fi
516+ fi
508517}
509518
510519# Proxy extention format validator
You can’t perform that action at this time.
0 commit comments