From 16d9ad13e3ecba4bfbf7c0d1df1be5cab52c157a Mon Sep 17 00:00:00 2001 From: smos Date: Sun, 6 Jan 2013 10:24:04 +0100 Subject: Update the GUI page for the DHCP6 server, add a if statement that prevents throwing range errors on interface that have no static IPv6 address. It is entirely valid to operate a DHCP6 server just for prefix delegation, but ISC doesn't appear to allow it yet. --- usr/local/www/services_dhcpv6.php | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'usr') diff --git a/usr/local/www/services_dhcpv6.php b/usr/local/www/services_dhcpv6.php index e2f83f0..524df12 100644 --- a/usr/local/www/services_dhcpv6.php +++ b/usr/local/www/services_dhcpv6.php @@ -75,6 +75,7 @@ if (!$_GET['if']) "

" . gettext("Only interfaces configured with a static IP will be shown") . ".

"; $iflist = get_configured_interface_with_descr(); +$iflist = array_merge($iflist, get_configured_pppoe_server_interfaces()); /* set the starting interface */ if (!$if || !isset($iflist[$if])) { @@ -232,11 +233,12 @@ if ($_POST) { $subnet_start = gen_subnetv6($ifcfgip, $ifcfgsn); $subnet_end = gen_subnetv6_max($ifcfgip, $ifcfgsn); - if ((! is_inrange($_POST['range_from'], $subnet_start, $subnet_end)) || - (! is_inrange($_POST['range_to'], $subnet_start, $subnet_end))) { - $input_errors[] = gettext("The specified range lies outside of the current subnet."); + if (is_ipaddrv6($ifcfgip)) { + if ((! is_inrange($_POST['range_from'], $subnet_start, $subnet_end)) || + (! is_inrange($_POST['range_to'], $subnet_start, $subnet_end))) { + $input_errors[] = gettext("The specified range lies outside of the current subnet."); + } } - /* "from" cannot be higher than "to" */ if (inet_pton($_POST['range_from']) > inet_pton($_POST['range_to'])) $input_errors[] = gettext("The range is invalid (first element higher than second element)."); @@ -486,6 +488,22 @@ include("head.inc"); $tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}"); $tabscounter++; } + /* tack on PPPoE or PPtP servers here */ + /* pppoe server */ + if (is_array($config['pppoes']['pppoe'])) { + foreach($config['pppoes']['pppoe'] as $pppoe) { + if ($pppoe['mode'] == "server") { + $ifent = "poes". $pppoe['pppoeid']; + $ifname = strtoupper($ifent); + if ($ifent == $if) + $active = true; + else + $active = false; + $tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}"); + $tabscounter++; + } + } + } if ($tabscounter == 0) { echo ""; include("fend.inc"); @@ -524,6 +542,10 @@ display_top_tabs($tab_array); + @@ -551,6 +573,8 @@ display_top_tabs($tab_array); ?> + + -- cgit v1.1