summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-10-23 12:25:22 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-10-23 12:25:22 -0200
commite112f9ee60b39f19cae673ba9e68b842531f521b (patch)
treefe47d7bb6e4c8e76b96561d4686e07cd7f266904
parenta376c57de58765dbd469cb07ee3108da49a2657d (diff)
parent29b3bb05e045430bf0346998e0968383ce851b3d (diff)
downloadpfsense-e112f9ee60b39f19cae673ba9e68b842531f521b.zip
pfsense-e112f9ee60b39f19cae673ba9e68b842531f521b.tar.gz
Merge pull request #1312 from phil-davis/patch-8
-rw-r--r--etc/inc/util.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index e410d3b..cb90aa7 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -394,6 +394,13 @@ function ip_range_to_subnet_array($startip, $endip) {
return array();
}
+ if (ip_greater_than($startip, $endip)) {
+ // Swap start and end so we can process sensibly.
+ $temp = $startip;
+ $startip = $endip;
+ $endip = $temp;
+ }
+
// Container for subnets within this range.
$rangesubnets = array();
@@ -433,7 +440,7 @@ function ip_range_to_subnet_array($startip, $endip) {
}
}
- // Some logic that will recursivly search from $startip to the first IP before the start of the subnet we just found.
+ // Some logic that will recursively search from $startip to the first IP before the start of the subnet we just found.
// NOTE: This may never be hit, the way the above algo turned out, but is left for completeness.
if ($startip != $targetsub_min) {
$rangesubnets = array_merge($rangesubnets, ip_range_to_subnet_array($startip, ip_before($targetsub_min)));
OpenPOWER on IntegriCloud