diff --git a/src/etc/inc/plugins.inc.d/dhcpd.inc b/src/etc/inc/plugins.inc.d/dhcpd.inc index ad354a76e..e671c6791 100644 --- a/src/etc/inc/plugins.inc.d/dhcpd.inc +++ b/src/etc/inc/plugins.inc.d/dhcpd.inc @@ -1144,8 +1144,8 @@ EOD; $smdnscfg .= " option domain-search \"" . join("\",\"", preg_split("/[ ;]+/", $sm['domainsearchlist'])) . "\";\n"; } - if (isset($sm['ddnsupdate'])) { - if (($sm['ddnsdomain'] != '') && ($sm['ddnsdomain'] != $dhcpifconf['ddnsdomain'])) { + if ($need_ddns_updates) { + if (!empty($sm['ddnsdomain']) && ($sm['ddnsdomain'] != $dhcpifconf['ddnsdomain'])) { $smdnscfg .= " ddns-domainname \"{$sm['ddnsdomain']}\";\n"; } } diff --git a/src/www/services_dhcp_edit.php b/src/www/services_dhcp_edit.php index 6f2fd466f..c610c2a67 100644 --- a/src/www/services_dhcp_edit.php +++ b/src/www/services_dhcp_edit.php @@ -46,7 +46,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig = array(); $config_copy_fieldnames = array('mac', 'cid', 'hostname', 'filename', 'rootpath', 'descr', 'arp_table_static_entry', 'defaultleasetime', 'maxleasetime', 'gateway', 'domain', 'domainsearchlist', 'winsserver', 'dnsserver', 'ddnsdomain', - 'ddnsupdate', 'ntpserver', 'tftp', 'bootfilename', 'ipaddr', 'winsserver', 'dnsserver'); + 'ntpserver', 'tftp', 'bootfilename', 'ipaddr', 'winsserver', 'dnsserver'); foreach ($config_copy_fieldnames as $fieldname) { if (isset($if) && isset($id) && isset($config['dhcpd'][$if]['staticmap'][$id][$fieldname])) { $pconfig[$fieldname] = $config['dhcpd'][$if]['staticmap'][$id][$fieldname]; @@ -216,7 +216,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $mapent = array(); $config_copy_fieldnames = array('mac', 'cid', 'ipaddr', 'hostname', 'descr', 'filename', 'rootpath', 'arp_table_static_entry', 'defaultleasetime', 'maxleasetime', 'gateway', 'domain', 'domainsearchlist', - 'ddnsdomain', 'ddnsupdate', 'tftp', 'bootfilename', 'winsserver', 'dnsserver'); + 'ddnsdomain', 'tftp', 'bootfilename', 'winsserver', 'dnsserver'); foreach ($config_copy_fieldnames as $fieldname) { if (!empty($pconfig[$fieldname])) { @@ -226,7 +226,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { // boolean $mapent['arp_table_static_entry'] = !empty($pconfig['arp_table_static_entry']); - $mapent['ddnsupdate'] = !empty($pconfig['ddnsupdate']); // arrays $mapent['winsserver'] = array(); @@ -284,11 +283,6 @@ include("head.inc");