Skip to content

Commit 95ee3e1

Browse files
Bug 35308671 JCS-13865 (#212)
1 parent 129d362 commit 95ee3e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

terraform/modules/network-validator/scripts/network_validation.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ function in_cidr_range() {
7272

7373
subnet_ip=$(echo "${cidr_subnet}" | cut -d'/' -f1)
7474
cidr_mask=$(echo "${cidr_subnet}" | cut -d'/' -f2)
75+
ip_addr_ip=$(echo "${ip_addr}" | cut -d'/' -f1)
7576

7677
netmask=$(( 0xFFFFFFFF << $(( 32 - ${cidr_mask} )) ))
7778

7879
# Apply netmask to both the subnet IP and the given IP address
79-
ip_addr_subnet=$(( netmask & $(ip_to_int ${ip_addr}) ))
80+
ip_addr_subnet=$(( netmask & $(ip_to_int ${ip_addr_ip}) ))
8081
subnet=$(( netmask & $(ip_to_int ${subnet_ip}) ))
8182

8283
# Subnet IPs will match if given IP address is in CIDR subnet

0 commit comments

Comments
 (0)