diff options
author | jim-p <jimp@pfsense.org> | 2017-08-24 11:10:36 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2017-08-24 11:11:24 -0400 |
commit | 79ccd1f2796059a7a60b865a383dc288662f86b7 (patch) | |
tree | 18fdade905d15748c365bc2190e24e2fcc441219 /src | |
parent | a1c3244c96b033891136ff2d95be61500a720231 (diff) | |
download | pfsense-79ccd1f2796059a7a60b865a383dc288662f86b7.zip pfsense-79ccd1f2796059a7a60b865a383dc288662f86b7.tar.gz |
Setup upgrade code for wireless interfaces to the new format needed for 2.4, and switch rc.bootup so the config upgrade happens before a mismatch test, otherwise we can't fix this type of situation. Fixes #7809
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 28 | ||||
-rwxr-xr-x | src/etc/rc.bootup | 12 |
2 files changed, 35 insertions, 5 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index 7a38554..023292f 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -5392,6 +5392,34 @@ function upgrade_168_to_169() { ); } +/* Upgrade wireless interfaces to the format required for 2.4 + * Each wireless interface now needs to be a cloned instance, the card itself + * Can no longer be assigned. https://redmine.pfsense.org/issues/6770 */ +function upgrade_169_to_170() { + global $config; + foreach ($config['interfaces'] as $friendly => & $iface) { + if (is_array($iface['wireless']) && !empty($iface['wireless']['mode'])) { + /* This test can only be true for one instance per card, so it is safe. */ + if (stristr($iface['if'], '_wlan') === false) { + $wlan = array(); + $wlan['if'] = $iface['if']; + $wlan['mode'] = $iface['wireless']['mode']; + $wlan['descr'] = "Wireless interface {$friendly}"; + /* It was not possible to create clones of _wlan0 before, so this is safe. */ + $wlan['cloneif'] = "{$iface['if']}_wlan0"; + /* Make sure this entry is first in the list of wireless interface clones. */ + if (!is_array($config['wireless'])) { + $config['wireless'] = array(); + $config['wireless']['clone'] = array(); + } + $config['wireless']['clone'][] = $wlan; + /* The interface assignment must now be the cloned interface name. */ + $iface['if'] = $wlan['cloneif']; + } + } + } +} + /* * Special function that is called independent of current config version. It's * a workaround to have config_upgrade running on older versions after next diff --git a/src/etc/rc.bootup b/src/etc/rc.bootup index aba6862..cc0f500 100755 --- a/src/etc/rc.bootup +++ b/src/etc/rc.bootup @@ -121,6 +121,13 @@ if (file_exists("/conf/trigger_initial_wizard") && !file_exists("/conf/assign_co check_for_alternate_interfaces(); } +/* Convert configuration + * This must happen before the interface mismatch test, see + * https://redmine.pfsense.org/issues/7809 */ +echo "Updating configuration..."; +convert_config(); +echo "done.\n"; + /* * Determine if we need to throw a interface exception * and ask the user to reassign interfaces. This will @@ -146,11 +153,6 @@ while (is_interface_mismatch() == true) { led_kitt(); } -/* convert config and clean backups */ -echo "Updating configuration..."; -convert_config(); -echo "done.\n"; - echo "Checking config backups consistency..."; cleanup_backupcache(true); echo "done.\n"; |