Project

General

Profile

« Previous | Next » 

Revision 67784aa6

Added by Steve Beaver over 7 years ago

Add DDNS client update option to DHCPv4 configuraiton

View differences:

src/etc/inc/services.inc
693 693
				$newzone['domain-name'] = $config['system']['domain'];
694 694
			}
695 695

  
696
			if (empty($dhcpifconf['ddnsclientupdates'])) {
697
				$ddnsclientupdates = 'allow';
698
			} else {
699
				$ddnsclientupdates = $dhcpifconf['ddnsclientupdates'];
700
			}
701

  
702
			$dnscfg .= "	{$ddnsclientupdates} client-updates;\n";
703

  
696 704
			$revsubnet = array_reverse(explode('.',$subnet));
697 705

  
698 706
			/* Take care of full classes first */
......
2209 2217
			$wanif = get_real_interface("wan", "inet6");
2210 2218
			if (platform_booting()) {
2211 2219
				for ($i=1; $i <= 10; $i++) {
2212
					if (!file_exists("/tmp/{$wanif}_dhcp6_complete")) { 
2220
					if (!file_exists("/tmp/{$wanif}_dhcp6_complete")) {
2213 2221
						log_error(gettext("Unbound start waiting on dhcp6c."));
2214 2222
						sleep(1);
2215 2223
					} else {
2216 2224
						unlink_if_exists("/tmp/{$wanif}_dhcp6_complete");
2217 2225
						log_error(gettext("dhcp6 init complete. Continuing"));
2218 2226
						break;
2219
					}						
2227
					}
2220 2228
				}
2221 2229
			}
2222 2230
		}
2223
		
2231

  
2224 2232
		sync_unbound_service();
2225 2233
		if (platform_booting()) {
2226 2234
			log_error(gettext("sync unbound done."));
src/usr/local/www/services_dhcp.php
201 201
	$pconfig['netmask'] = $dhcpdconf['netmask'];
202 202
	$pconfig['numberoptions'] = $dhcpdconf['numberoptions'];
203 203
	$pconfig['statsgraph'] = $dhcpdconf['statsgraph'];
204
	$pconfig['ddnsclientupdates'] = $dhcpdconf['ddnsclientupdates'];
204 205
}
205 206

  
206 207
$ifcfgip = $config['interfaces'][$if]['ipaddr'];
......
585 586
		$dhcpdconf['ddnsforcehostname'] = ($_POST['ddnsforcehostname']) ? true : false;
586 587
		$dhcpdconf['mac_allow'] = $_POST['mac_allow'];
587 588
		$dhcpdconf['mac_deny'] = $_POST['mac_deny'];
589
		$dhcpdconf['ddnsclientupdates'] = $_POST['ddnsclientupdates'];
588 590

  
589 591
		unset($dhcpdconf['ntpserver']);
590 592
		if ($_POST['ntp1']) {
......
1145 1147
	$pconfig['ddnsdomainkey']
1146 1148
))->setHelp('Dynamic DNS domain key secret which will be used to register client names in the DNS server.');
1147 1149

  
1150
$section->addInput(new Form_Select(
1151
	'ddnsclientupdates',
1152
	'DDNS Client Updates',
1153
	$pconfig['ddnsclientupdates'],
1154
	array(
1155
	    'allow' => gettext('Allow'),
1156
	    'deny' => gettext('Deny'),
1157
	    'ignore' => gettext('Ignore'))
1158
))->setHelp('How Forward entries are handled when client indicates they wish to update DNS.  ' .
1159
	    'Allow prevents DHCP from updating Forward entries, Deny indicates that DHCP will ' .
1160
	    'do the updates and the client should not, Ignore specifies that DHCP will do the ' .
1161
	    'update and the client can also attempt the update usually using a different domain name.');
1162

  
1148 1163
// Advanced MAC
1149 1164
$btnadv = new Form_Button(
1150 1165
	'btnadvmac',
......
1535 1550
		// On page load decide the initial state based on the data.
1536 1551
		if (ispageload) {
1537 1552
<?php
1538
			if (!$pconfig['ddnsupdate'] && !$pconfig['ddnsforcehostname'] && empty($pconfig['ddnsdomain']) && empty($pconfig['ddnsdomainprimary']) &&
1539
			    empty($pconfig['ddnsdomainkeyname']) && empty($pconfig['ddnsdomainkeyalgorithm']) && empty($pconfig['ddnsdomainkey'])) {
1553
			if (!$pconfig['ddnsupdate'] &&
1554
				!$pconfig['ddnsforcehostname'] &&
1555
				empty($pconfig['ddnsdomain']) &&
1556
				empty($pconfig['ddnsdomainprimary']) &&
1557
			    empty($pconfig['ddnsdomainkeyname']) &&
1558
			    empty($pconfig['ddnsdomainkeyalgorithm']) &&
1559
			    (empty($pconfig['ddnsclientupdates']) || ($pconfig['ddnsclientupdates'] == "allow")) &&
1560
			    empty($pconfig['ddnsdomainkey'])) {
1540 1561
				$showadv = false;
1541 1562
			} else {
1542 1563
				$showadv = true;
......
1555 1576
		hideInput('ddnsdomainkeyname', !showadvdns);
1556 1577
		hideInput('ddnsdomainkeyalgorithm', !showadvdns);
1557 1578
		hideInput('ddnsdomainkey', !showadvdns);
1579
		hideInput('ddnsclientupdates', !showadvdns);
1558 1580

  
1559 1581
		if (showadvdns) {
1560 1582
			text = "<?=gettext('Hide Advanced');?>";

Also available in: Unified diff