summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-01-24 12:30:49 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-01-24 12:30:49 -0200
commit41b4867edaa639a819d9c998c766397c4844bad5 (patch)
tree22ee5720a38ccefec7e4335102960766345ab64e /etc/inc/util.inc
parenta78bf0c8b382d104638f1e02582a5a64a46800a6 (diff)
downloadpfsense-41b4867edaa639a819d9c998c766397c4844bad5.zip
pfsense-41b4867edaa639a819d9c998c766397c4844bad5.tar.gz
Move is_inrange() to util.inc and rename it to is_inrange_v6()
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index f9e18fc..0cc2692 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -687,6 +687,14 @@ function is_inrange_v4($test, $start, $end) {
return false;
}
+/* returns true if $test is in the range between $start and $end */
+function is_inrange_v6($test, $start, $end) {
+ if ( (inet_pton($test) <= inet_pton($end)) && (inet_pton($test) >= inet_pton($start)) )
+ return true;
+ else
+ return false;
+}
+
/* return the configured carp interface list */
function get_configured_carp_interface_list() {
global $config;
OpenPOWER on IntegriCloud