Project

General

Profile

« Previous | Next » 

Revision 16d9ad13

Added by Seth Mos over 12 years ago

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.

View differences:

usr/local/www/services_dhcpv6.php
75 75
		   "<p><b>" . gettext("Only interfaces configured with a static IP will be shown") . ".</b></p>";
76 76

  
77 77
$iflist = get_configured_interface_with_descr();
78
$iflist = array_merge($iflist, get_configured_pppoe_server_interfaces());
78 79

  
79 80
/* set the starting interface */
80 81
if (!$if || !isset($iflist[$if])) {
......
232 233
			$subnet_start = gen_subnetv6($ifcfgip, $ifcfgsn);
233 234
			$subnet_end = gen_subnetv6_max($ifcfgip, $ifcfgsn);
234 235

  
235
			if ((! is_inrange($_POST['range_from'], $subnet_start, $subnet_end)) ||
236
			    (! is_inrange($_POST['range_to'], $subnet_start, $subnet_end))) {
237
				$input_errors[] = gettext("The specified range lies outside of the current subnet.");
236
			if (is_ipaddrv6($ifcfgip)) {
237
				if ((! is_inrange($_POST['range_from'], $subnet_start, $subnet_end)) ||
238
			   	 (! is_inrange($_POST['range_to'], $subnet_start, $subnet_end))) {
239
					$input_errors[] = gettext("The specified range lies outside of the current subnet.");
240
				}
238 241
			}
239

  
240 242
			/* "from" cannot be higher than "to" */
241 243
			if (inet_pton($_POST['range_from']) > inet_pton($_POST['range_to']))
242 244
				$input_errors[] = gettext("The range is invalid (first element higher than second element).");
......
486 488
		$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
487 489
		$tabscounter++;
488 490
	}
491
	/* tack on PPPoE or PPtP servers here */
492
	/* pppoe server */
493
	if (is_array($config['pppoes']['pppoe'])) {
494
		foreach($config['pppoes']['pppoe'] as $pppoe) {
495
			if ($pppoe['mode'] == "server") {
496
				$ifent = "poes". $pppoe['pppoeid'];
497
				$ifname = strtoupper($ifent);
498
				if ($ifent == $if)
499
					$active = true;
500
				else
501
					$active = false;
502
				$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
503
				$tabscounter++;
504
			}
505
		}
506
	}
489 507
	if ($tabscounter == 0) {
490 508
		echo "</td></tr></table></form>";
491 509
		include("fend.inc");
......
524 542
				<?=gettext("If this is checked, only the clients defined below will get DHCP leases from this server. ");?></td>
525 543
			</tr>
526 544
			<tr>
545
			<?php
546
			/* the PPPoE Server could well have no IPv6 address and operate fine with just link-local, just hide these */
547
			if(is_ipaddrv6($ifcfgip)) {
548
			?>
527 549
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet");?></td>
528 550
			<td width="78%" class="vtable">
529 551
				<?=gen_subnetv6($ifcfgip, $ifcfgsn);?>
......
551 573
			?>
552 574
			</td>
553 575
			</tr>
576
			<?php } ?>
577

  
554 578
			<?php if($is_olsr_enabled): ?>
555 579
			<tr>
556 580
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Subnet Mask");?></td>

Also available in: Unified diff