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/etc/inc | |
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/etc/inc')
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 28 |
1 files changed, 28 insertions, 0 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 |