summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-12-06 09:41:59 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-12-06 09:41:59 -0200
commitda6cb29eb5a53c1f4356ffd8ceb781ad61c3e499 (patch)
treef42f16801025a6b96d7d685a6cf951f4c02285dd
parentbebf0fa8dcb860e2395a0e7cd087c16b3283726d (diff)
downloadpfsense-da6cb29eb5a53c1f4356ffd8ceb781ad61c3e499.zip
pfsense-da6cb29eb5a53c1f4356ffd8ceb781ad61c3e499.tar.gz
Add function is_inrange() that calls is_inrange_v6 or is_inrange_v4 accordingly
-rw-r--r--etc/inc/util.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 968cb72..6e91eb6 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -794,6 +794,11 @@ function is_inrange_v6($test, $start, $end) {
return false;
}
+/* returns true if $test is in the range between $start and $end */
+function is_inrange($test, $start, $end) {
+ return is_ipaddrv6($test) ? is_inrange_v6($test, $start, $end) : is_inrange_v4($test, $start, $end);
+}
+
/* XXX: return the configured carp interface list */
function get_configured_carp_interface_list() {
global $config;
OpenPOWER on IntegriCloud