Project

General

Profile

« Previous | Next » 

Revision 6c8beed3

Added by Renato Botelho over 9 years ago

Ticket #3029

Fix DHCPv6 GUI to work with PD length != 64

View differences:

src/usr/local/www/services_dhcpv6.php
153 153
}
154 154

  
155 155
if ($config['interfaces'][$if]['ipaddrv6'] == 'track6') {
156
	$trackifname = $config['interfaces'][$if]['track6-interface'];
157
	$trackcfg = $config['interfaces'][$trackifname];
158
	$ifcfgsn = 64 - $trackcfg['dhcp6-ia-pd-len'];
156 159
	$ifcfgip = '::';
157
	$ifcfgsn = 64;
160

  
161
	$str_help_mask = dhcpv6_pd_str_help($ifcfgsn);
158 162
} else {
159 163
	$ifcfgip = get_interface_ipv6($if);
160 164
	$ifcfgsn = get_interface_subnetv6($if);
......
244 248
			if (!is_ipaddrv6($_POST['range_from'])) {
245 249
				$input_errors[] = gettext("A valid range must be specified.");
246 250
			} elseif ($config['interfaces'][$if]['ipaddrv6'] == 'track6' &&
247
			    !Net_IPv6::isInNetmask($_POST['range_from'], '::', 64)) {
248
				$input_errors[] = gettext("The prefix (upper 64 bits) must be zero.  Use the form ::x:x:x:x");
251
			    !Net_IPv6::isInNetmask($_POST['range_from'], '::', $ifcfgsn)) {
252
				$input_errors[] = sprintf(gettext(
253
				    "The prefix (upper %s bits) must be zero.  Use the form %s"),
254
				    $ifcfgsn, $str_help_mask);
249 255
			}
250 256
		}
251 257
		if ($_POST['range_to']) {
252 258
			if (!is_ipaddrv6($_POST['range_to'])) {
253 259
				$input_errors[] = gettext("A valid range must be specified.");
254 260
			} elseif ($config['interfaces'][$if]['ipaddrv6'] == 'track6' &&
255
			    !Net_IPv6::isInNetmask($_POST['range_to'], '::', 64)) {
256
				$input_errors[] = gettext("The prefix (upper 64 bits) must be zero.  Use the form ::x:x:x:x");
261
			    !Net_IPv6::isInNetmask($_POST['range_to'], '::', $ifcfgsn)) {
262
				$input_errors[] = sprintf(gettext(
263
				    "The prefix (upper %s bits) must be zero.  Use the form %s"),
264
				    $ifcfgsn, $str_help_mask);
257 265
			}
258 266
		}
259 267
		if (($_POST['gateway'] && !is_ipaddrv6($_POST['gateway']))) {

Also available in: Unified diff