summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/services.inc4
-rw-r--r--etc/inc/util.inc3
-rwxr-xr-xusr/local/www/firewall_virtual_ip_edit.php2
-rwxr-xr-xusr/local/www/system_routes_edit.php2
4 files changed, 6 insertions, 5 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 7ffb555..4016d45 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -1001,10 +1001,10 @@ EOD;
}
if(is_ipaddrv6(ifcfgipv6)) {
- $subnet6 = Net_IPv6::compress(gen_subnetv6($ifcfgipv6, $ifcfgsnv6));
+ $subnet6 = gen_subnetv6($ifcfgipv6, $ifcfgsnv6);
$dhcpdv6conf .= "subnet6 {$subnet6}/{$ifcfgsnv6} {\n";
} else {
- $subnet6 = Net_IPv6::compress(gen_subnetv6($dhcpv6ifconf['range']['from'], "64"));
+ $subnet6 = gen_subnetv6($dhcpv6ifconf['range']['from'], "64");
$dhcpdv6conf .= "subnet6 {$subnet6}/64 {\n";
}
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 74b11ce..e137c68 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -284,6 +284,7 @@ function gen_subnetv6($ipaddr, $bits) {
return "";
$address = Net_IPv6::getNetmask($ipaddr, $bits);
+ $address = Net_IPv6::compress($address);
return $address;
}
@@ -307,7 +308,7 @@ function gen_subnetv6_max($ipaddr, $bits) {
$inet_end = $inet_ip | ~$inet_mask;
- return(Net_IPv6::uncompress(inet_ntop($inet_end)));
+ return (inet_ntop($inet_end));
}
/* returns a subnet mask (long given a bit count) */
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php
index d208dd3..8682d5e 100755
--- a/usr/local/www/firewall_virtual_ip_edit.php
+++ b/usr/local/www/firewall_virtual_ip_edit.php
@@ -167,7 +167,7 @@ if ($_POST) {
$parent_ip = get_interface_ipv6($_POST['interface']);
$parent_sn = get_interface_subnetv6($_POST['interface']);
$subnet = gen_subnetv6($parent_ip, $parent_sn);
- if (!ip_in_subnet($_POST['subnet'], gen_subnetv6($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['interface'], $_POST['subnet'])) {
+ if (!ip_in_subnet($_POST['subnet'], "{$subnet}/{$parent_sn}") && !ip_in_interface_alias_subnet($_POST['interface'], $_POST['subnet'])) {
$cannot_find = $_POST['subnet'] . "/" . $_POST['subnet_bits'] ;
$input_errors[] = sprintf(gettext("Sorry, we could not locate an interface with a matching subnet for %s. Please add an IP alias in this subnet on this interface."),$cannot_find);
}
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php
index 98e264b..1a27e88 100755
--- a/usr/local/www/system_routes_edit.php
+++ b/usr/local/www/system_routes_edit.php
@@ -110,7 +110,7 @@ if ($_POST) {
$current_targets = get_staticroutes(true);
$new_targets = array();
if(is_ipaddrv6($_POST['network'])) {
- $osn = Net_IPv6::compress(gen_subnetv6($_POST['network'], $_POST['network_subnet'])) . "/" . $_POST['network_subnet'];
+ $osn = gen_subnetv6($_POST['network'], $_POST['network_subnet']) . "/" . $_POST['network_subnet'];
$new_targets[] = $osn;
}
if (is_ipaddrv4($_POST['network'])) {
OpenPOWER on IntegriCloud