summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/services.inc
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2017-12-27 09:39:46 -0500
committerSteve Beaver <sbeaver@netgate.com>2017-12-27 09:39:46 -0500
commitf0584e6dfe768280307924855ae83126bbeced28 (patch)
treef6bf3f3f6b62ec39612ece45940128cd03c3ac21 /src/etc/inc/services.inc
parent918ef12c73364f28fe19891e9d13f57f454c897c (diff)
parente5c4b4fc75771fc5f47d0912268e183c43451ad4 (diff)
downloadpfsense-f0584e6dfe768280307924855ae83126bbeced28.zip
pfsense-f0584e6dfe768280307924855ae83126bbeced28.tar.gz
Merge pull request #3887 from JoeriCapens/dhcp-ddns-algorithm-choice
Diffstat (limited to 'src/etc/inc/services.inc')
-rw-r--r--src/etc/inc/services.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index 11fee1b..f0a204f 100644
--- a/src/etc/inc/services.inc
+++ b/src/etc/inc/services.inc
@@ -1169,6 +1169,7 @@ EOD;
if ($need_ddns_updates) {
$newzone['dns-servers'] = array($dhcpifconf['ddnsdomainprimary']);
$newzone['ddnsdomainkeyname'] = $dhcpifconf['ddnsdomainkeyname'];
+ $newzone['ddnsdomainkeyalgorithm'] = $dhcpifconf['ddnsdomainkeyalgorithm'];
$newzone['ddnsdomainkey'] = $dhcpifconf['ddnsdomainkey'];
$dhcpdconf .= dhcpdkey($dhcpifconf);
}
@@ -1215,9 +1216,10 @@ EOD;
function dhcpdkey($dhcpifconf) {
$dhcpdconf = "";
- if ($dhcpifconf['ddnsdomainkeyname'] <> "" && $dhcpifconf['ddnsdomainkey'] <> "") {
+ if (!empty($dhcpifconf['ddnsdomainkeyname']) && !empty($dhcpifconf['ddnsdomainkey'])) {
+ $algorithm = empty($dhcpifconf['ddnsdomainkeyalgorithm']) ? 'hmac-md5' : $dhcpifconf['ddnsdomainkeyalgorithm'];
$dhcpdconf .= "key {$dhcpifconf['ddnsdomainkeyname']} {\n";
- $dhcpdconf .= " algorithm hmac-md5;\n";
+ $dhcpdconf .= " algorithm {$algorithm};\n";
$dhcpdconf .= " secret {$dhcpifconf['ddnsdomainkey']};\n";
$dhcpdconf .= "}\n";
}
OpenPOWER on IntegriCloud