Fixed exit from ip verification function

This commit is contained in:
Andrey Savihin 2020-02-17 14:35:18 +03:00
parent e1445c69db
commit c53040da3b
1 changed files with 14 additions and 14 deletions

View File

@ -179,10 +179,10 @@ check_ip_is_internal(){
local INIP=($(echo "$2" | sed -ne 's:^'"$IPRE"'$:\1 \2 \3 \4:p'))
for (( I=0; I<4; I++ )); do
[[ $(( ${INIP[$I]} & ${MASK[$I]} )) -ne ${NETWORK[$I]} ]] && exit 0;
[[ $(( ${INIP[$I]} & ${MASK[$I]} )) -ne ${NETWORK[$I]} ]] && return 1; #false
done
echo "true"
return 0; #true
}
normalize_subnet(){