Project

General

Profile

« Previous | Next » 

Revision 18f3c2fd

Added by Daniel Becker almost 12 years ago

add option to send prefix hint for requesting desired prefix length for delegation

This change adds an option on the interfaces page for sending a prefix hint for the selected delegation size. If enabled, a "prefix" field requesting :: with the appropriate prefix length (64 - dhcp6-ia-pd-len) is added to the "id-assoc pd" entry in the dhcp6c config file. This hint is required for requesting prefixes shorter than /64 from Comcast.

View differences:

etc/inc/interfaces.inc
3512 3512
		if(is_numeric($wancfg['dhcp6-ia-pd-len'])) {
3513 3513
			/* Setup the prefix delegation */
3514 3514
			$dhcp6cconf .= "id-assoc pd 0 {\n";
3515
			$preflen = 64 - $wancfg['dhcp6-ia-pd-len'];
3516
			if (isset($wancfg['dhcp6-ia-pd-send-hint']))
3517
				$dhcp6cconf .= "	prefix ::/{$preflen} infinity;\n";
3515 3518
			$iflist = link_interface_to_track6($interface);
3516 3519
			foreach ($iflist as $friendly => $ifcfg) {
3517 3520
				if (is_numeric($ifcfg['track6-prefix-id'])) {
......
3524 3527
					$dhcp6cconf .= "	};\n";
3525 3528
				}
3526 3529
			}
3527
			unset($iflist, $ifcfg);
3530
			unset($preflen, $iflist, $ifcfg);
3528 3531
			$dhcp6cconf .= "};\n";
3529 3532
		}
3530 3533
	}
usr/local/www/interfaces.php
272 272
		if(!isset($wancfg['dhcp6-ia-pd-len']))
273 273
			$wancfg['dhcp6-ia-pd-len'] = "none";
274 274
		$pconfig['dhcp6-ia-pd-len'] = $wancfg['dhcp6-ia-pd-len'];
275
		$pconfig['dhcp6-ia-pd-send-hint'] = isset($wancfg['dhcp6-ia-pd-send-hint']);
275 276
		$pconfig['type6'] = "dhcp6";
276 277
		$pconfig['dhcp6prefixonly'] = isset($wancfg['dhcp6prefixonly']);
277 278
		$pconfig['dhcp6usev4iface'] = isset($wancfg['dhcp6usev4iface']);
......
802 803
		unset($wancfg['dhcprejectfrom']);
803 804
		unset($wancfg['dhcp6-duid']);
804 805
		unset($wancfg['dhcp6-ia-pd-len']);
806
		unset($wancfg['dhcp6-ia-pd-send-hint']);
805 807
		unset($wancfg['dhcp6prefixonly']);
806 808
		unset($wancfg['dhcp6usev4iface']);
807 809
		unset($wancfg['track6-interface']);
......
1013 1015
				$wancfg['ipaddrv6'] = "dhcp6";
1014 1016
				$wancfg['dhcp6-duid'] = $_POST['dhcp6-duid'];
1015 1017
				$wancfg['dhcp6-ia-pd-len'] = $_POST['dhcp6-ia-pd-len'];
1018
				if($_POST['dhcp6-ia-pd-send-hint'] == "yes")
1019
					$wancfg['dhcp6-ia-pd-send-hint'] = true;
1016 1020
				if($_POST['dhcp6prefixonly'] == "yes")
1017 1021
					$wancfg['dhcp6prefixonly'] = true;
1018 1022
				if($_POST['dhcp6usev4iface'] == "yes")
......
2149 2153
											<?=gettext("The value in this field is the delegated prefix length provided by the DHCPv6 server. Normally specified by the ISP."); ?>
2150 2154
										</td>
2151 2155
									</tr>
2156
									<tr style='display:none' name="basicdhcp6_show_dhcp6_prefix_send_hint" id="basicdhcp6_show_dhcp6_prefix_send_hint">
2157
										<td width="22%" valign="top" class="vncell"><?=gettext("Send IPv6 prefix hint"); ?></td>
2158
										<td width="78%" class="vtable">
2159
											<input name="dhcp6-ia-pd-send-hint" type="checkbox" id="dhcp6-ia-pd-send-hint" value="yes" <?php if ($pconfig['dhcp6-ia-pd-send-hint'] == true) echo "checked=\"checked\""; ?> />
2160
											<?=gettext("Send an IPv6 prefix hint to indicate the desired prefix size for delegation"); ?>
2161
										</td>
2162
									</tr>
2152 2163

  
2153 2164
									<tr style='display:none' name="show_adv_dhcp6_interface_statement" id="show_adv_dhcp6_interface_statement">
2154 2165
										<td width="22%" valign="top" class="vncell">
......
2304 2315

  
2305 2316
											document.getElementById("basicdhcp6_use_pppoeinterface").style.display = basic;
2306 2317
											document.getElementById("basicdhcp6_show_dhcp6_prefix_delegation_size").style.display = basic;
2318
											document.getElementById("basicdhcp6_show_dhcp6_prefix_send_hint").style.display = basic;
2307 2319
											document.getElementById("basicdhcp6_show_dhcp6_prefix_only").style.display = basic;
2308 2320

  
2309 2321
											document.getElementById("show_adv_dhcp6_interface_statement").style.display = advanced;

Also available in: Unified diff