From 4f721fc0f2b2bcde44d83f7597cbfbdceaa64060 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 12 Nov 2018 17:49:46 +0100 Subject: [PATCH] dhcp: more conversion --- src/www/services_dhcpv6.php | 6 ++---- src/www/system_gateways_edit.php | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/www/services_dhcpv6.php b/src/www/services_dhcpv6.php index ac302c593..275c44c10 100644 --- a/src/www/services_dhcpv6.php +++ b/src/www/services_dhcpv6.php @@ -188,8 +188,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (count($input_errors) == 0) { /* make sure the range lies within the current subnet */ - $ifcfgip = get_interface_ipv6($if); - $ifcfgsn = get_interface_subnetv6($if); + list ($ifcfgip, $ifcfgsn) = explode('/', find_interface_networkv6(get_real_interface($if, 'inet6'), false)); $subnet_start = gen_subnetv6($ifcfgip, $ifcfgsn); $subnet_end = gen_subnetv6_max($ifcfgip, $ifcfgsn); @@ -329,8 +328,7 @@ legacy_html_escape_form_data($pconfig); include("head.inc"); -$wifcfgip = get_interface_ipv6($if); -$wifcfgsn = get_interface_subnetv6($if); +list ($wifcfgip, $wifcfgsn) = explode('/', find_interface_networkv6(get_real_interface($if, 'inet6'), false)); if (isset($config['interfaces'][$if]['dhcpd6track6allowoverride'])) { $prefix_array = array(); diff --git a/src/www/system_gateways_edit.php b/src/www/system_gateways_edit.php index 22fb6cb93..2b1e7776e 100644 --- a/src/www/system_gateways_edit.php +++ b/src/www/system_gateways_edit.php @@ -72,7 +72,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!empty($pconfig['gateway']) && is_ipaddr($pconfig['gateway'])) { if (is_ipaddrv4($pconfig['gateway'])) { - list ($parent_ip, $parent_sn) = explode('/', find_interface_network(get_real_interface($pconfig['interface']), true)); + list ($parent_ip, $parent_sn) = explode('/', find_interface_network(get_real_interface($pconfig['interface']), false)); $parent_ip = empty($pconfig['ajaxip']) ? $parent_ip : $pconfig['ajaxip']; $parent_sn = empty($pconfig['ajaxnet']) ? $parent_sn : $pconfig['ajaxnet']; if (empty($parent_ip) || empty($parent_sn)) { @@ -104,7 +104,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } elseif (is_ipaddrv6($pconfig['gateway'])) { /* do not do a subnet match on a link local address, it's valid */ if (!is_linklocal($pconfig['gateway'])) { - list ($parent_ip, $parent_sn) = explode('/', find_interface_networkv6(get_real_interface($pconfig['interface'], 'inet6'), true)); + list ($parent_ip, $parent_sn) = explode('/', find_interface_networkv6(get_real_interface($pconfig['interface'], 'inet6'), false)); $parent_ip = empty($pconfig['ajaxip']) ? $parent_ip : $pconfig['ajaxip']; $parent_sn = empty($pconfig['ajaxnet']) ? $parent_sn : $pconfig['ajaxnet']; if (empty($parent_ip) || empty($parent_sn)) {