summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstilez <stilez@users.noreply.github.com>2016-06-17 05:08:19 +0100
committerStephen Beaver <sbeaver@netgate.com>2016-06-22 11:48:16 -0400
commit76a56fcee5eaa6a8f9daf9c72e26a64004867a56 (patch)
treea8acd3858145706b948d2786398ecc50b3937e27
parent8c5128010599bb9a0083c90eeaa2b7d60135fa26 (diff)
downloadpfsense-76a56fcee5eaa6a8f9daf9c72e26a64004867a56.zip
pfsense-76a56fcee5eaa6a8f9daf9c72e26a64004867a56.tar.gz
Remove subnet_expand()
Function isn't used in main or packages repo, and in any case would need a complete rewrite to handle IPv6. (cherry picked from commit 6215902c4043726e633fcfac1c37c710ac398653)
-rw-r--r--src/etc/inc/util.inc24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc
index 5de5bd1..15f6acf 100644
--- a/src/etc/inc/util.inc
+++ b/src/etc/inc/util.inc
@@ -877,30 +877,6 @@ function subnet_size_by_netmask($iptype, $bits, $exact=false) {
}
}
-
-function subnet_expand($subnet) {
- if (is_subnetv4($subnet)) {
- return subnetv4_expand($subnet);
- } else if (is_subnetv6($subnet)) {
- return subnetv6_expand($subnet);
- } else {
- return $subnet;
- }
-}
-
-function subnetv4_expand($subnet) {
- $result = array();
- list ($ip, $bits) = explode("/", $subnet);
- $net = ip2long($ip);
- $mask = (0xffffffff << (32 - $bits));
- $net &= $mask;
- $size = round(exp(log(2) * (32 - $bits)));
- for ($i = 0; $i < $size; $i += 1) {
- $result[] = long2ip($net | $i);
- }
- return $result;
-}
-
/* find out whether two IPv4/IPv6 CIDR subnets overlap.
Note: CIDR overlap implies one is identical or included so largest sn will be the same */
function check_subnets_overlap($subnet1, $bits1, $subnet2, $bits2) {
OpenPOWER on IntegriCloud