We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 129d362 commit 95ee3e1Copy full SHA for 95ee3e1
terraform/modules/network-validator/scripts/network_validation.sh
@@ -72,11 +72,12 @@ function in_cidr_range() {
72
73
subnet_ip=$(echo "${cidr_subnet}" | cut -d'/' -f1)
74
cidr_mask=$(echo "${cidr_subnet}" | cut -d'/' -f2)
75
+ ip_addr_ip=$(echo "${ip_addr}" | cut -d'/' -f1)
76
77
netmask=$(( 0xFFFFFFFF << $(( 32 - ${cidr_mask} )) ))
78
79
# Apply netmask to both the subnet IP and the given IP address
- ip_addr_subnet=$(( netmask & $(ip_to_int ${ip_addr}) ))
80
+ ip_addr_subnet=$(( netmask & $(ip_to_int ${ip_addr_ip}) ))
81
subnet=$(( netmask & $(ip_to_int ${subnet_ip}) ))
82
83
# Subnet IPs will match if given IP address is in CIDR subnet
0 commit comments