diff options
author | jim-p <jimp@pfsense.org> | 2010-07-20 13:50:32 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-07-20 13:50:32 -0400 |
commit | 2b1b78e68c5ad448483371428b80841c024180c8 (patch) | |
tree | cd76da31fb9c190fd5d2ed5a6266568be5a220f8 /etc | |
parent | 496dcc199b5435cbd941b4ba89c9ded875f914fd (diff) | |
download | pfsense-2b1b78e68c5ad448483371428b80841c024180c8.zip pfsense-2b1b78e68c5ad448483371428b80841c024180c8.tar.gz |
Fix the RFC dns updates config upgrade. It would blow up on an incomplete/invalid config.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/upgrade_config.inc | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 104d5ac..fd4ad12 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1122,20 +1122,11 @@ function upgrade_047_to_048() { unset($config['dyndns']); } if (!empty($config['dnsupdate'])) { - $config['dnsupdates'][0]['dnsupdate'] = array(); - $pconfig = array(); - $pconfig['dnsupdate_enable'] = isset($config['dnsupdate'][0]['enable']); - $pconfig['dnsupdate_host'] = $config['dnsupdate'][0]['host']; - $pconfig['dnsupdate_ttl'] = $config['dnsupdate'][0]['ttl']; - if (!$pconfig['dnsupdate_ttl']) - $pconfig['dnsupdate_ttl'] = 60; - $pconfig['dnsupdate_keydata'] = $config['dnsupdate'][0]['keydata']; - $pconfig['dnsupdate_keyname'] = $config['dnsupdate'][0]['keyname']; - $pconfig['dnsupdate_keytype'] = $config['dnsupdate'][0]['keytype']; - if (!$pconfig['dnsupdate_keytype']) - $pconfig['dnsupdate_keytype'] = "zone"; - $pconfig['dnsupdate_server'] = $config['dnsupdate'][0]['server']; - $pconfig['dnsupdate_usetcp'] = isset($config['dnsupdate'][0]['usetcp']); + $pconfig = $config['dnsupdate'][0]; + if (!$pconfig['ttl']) + $pconfig['ttl'] = 60; + if (!$pconfig['keytype']) + $pconfig['keytype'] = "zone"; $pconfig['interface'] = "wan"; $config['dnsupdates']['dnsupdate'][] = $pconfig; unset($config['dnsupdate']); |