diff options
author | Steve Beaver <sbeaver@netgate.com> | 2017-12-27 09:39:46 -0500 |
---|---|---|
committer | Steve Beaver <sbeaver@netgate.com> | 2017-12-27 09:39:46 -0500 |
commit | f0584e6dfe768280307924855ae83126bbeced28 (patch) | |
tree | f6bf3f3f6b62ec39612ece45940128cd03c3ac21 /src/etc/inc/services.inc | |
parent | 918ef12c73364f28fe19891e9d13f57f454c897c (diff) | |
parent | e5c4b4fc75771fc5f47d0912268e183c43451ad4 (diff) | |
download | pfsense-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.inc | 6 |
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"; } |