diff options
author | stilez <stilez@users.noreply.github.com> | 2016-01-18 14:33:05 +0000 |
---|---|---|
committer | stilez <stilez@users.noreply.github.com> | 2016-01-18 14:33:05 +0000 |
commit | 62512efa08b485f0dbf7274d85ac439ddc9b7db2 (patch) | |
tree | e20aa7f3ad4c72066af8bea935d089fb6254c098 /src | |
parent | 94eb702ffe3bc20efa33da74bfea67349d039191 (diff) | |
download | pfsense-62512efa08b485f0dbf7274d85ac439ddc9b7db2.zip pfsense-62512efa08b485f0dbf7274d85ac439ddc9b7db2.tar.gz |
should be min($bits1, $bits2) for 'largest subnet'
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/util.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc index be1ffee..c767f25 100644 --- a/src/etc/inc/util.inc +++ b/src/etc/inc/util.inc @@ -860,7 +860,7 @@ function check_subnets_overlap($subnet1, $bits1, $subnet2, $bits2) { /* find out whether two IPv4 CIDR subnets overlap. Note: CIDR overlap means sn1/sn2 are identical or one is included in other. So sn using largest $bits will be the same */ function check_subnetsv4_overlap($subnet1, $bits1, $subnet2, $bits2) { - $largest_sn = max($bits1, $bits2); + $largest_sn = min($bits1, $bits2); $subnetv4_start1 = gen_subnetv4($subnet1, $largest_sn); $subnetv4_start2 = gen_subnetv4($subnet2, $largest_sn); @@ -875,7 +875,7 @@ function check_subnetsv4_overlap($subnet1, $bits1, $subnet2, $bits2) { /* find out whether two IPv6 CIDR subnets overlap. Note: CIDR overlap means sn1/sn2 are identical or one is included in other. So sn using largest $bits will be the same */ function check_subnetsv6_overlap($subnet1, $bits1, $subnet2, $bits2) { - $largest_sn = max($bits1, $bits2); + $largest_sn = min($bits1, $bits2); $subnetv6_start1 = gen_subnetv6($subnet1, $largest_sn); $subnetv6_start2 = gen_subnetv6($subnet2, $largest_sn); |