diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2016-03-05 21:28:37 -0600 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2016-03-05 21:33:14 -0600 |
commit | 86d1c9c22e073beb0b3c3fc3506b4184c07cf175 (patch) | |
tree | 9c89148d06de167b5b102231d428af4bddc898f6 | |
parent | 801d55590e6499471f21095d3f9807189a841bd7 (diff) | |
download | pfsense-86d1c9c22e073beb0b3c3fc3506b4184c07cf175.zip pfsense-86d1c9c22e073beb0b3c3fc3506b4184c07cf175.tar.gz |
If you are assigning interfaces, remove the existing configuration from old interfaces if any.
This fixes the need for a reboot after changing interface assignment in console.
-rw-r--r-- | src/etc/inc/config.console.inc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/etc/inc/config.console.inc b/src/etc/inc/config.console.inc index 5b88fbd..19fe910 100644 --- a/src/etc/inc/config.console.inc +++ b/src/etc/inc/config.console.inc @@ -330,6 +330,11 @@ EOD; if (in_array($key, array('y', 'Y'))) { if ($lanif) { + if (is_array($config['interfaces']['lan'])) { + $upints = pfSense_interface_listget(IFF_UP); + if (in_array($config['interfaces']['lan']['if'], $upints)) + interface_bring_down('lan', true); + } if (!is_array($config['interfaces']['lan'])) { $config['interfaces']['lan'] = array(); } @@ -403,6 +408,11 @@ EOD; } } + if (is_array($config['interfaces']['wan'])) { + $upints = pfSense_interface_listget(IFF_UP); + if (in_array($config['interfaces']['wan']['if'], $upints)) + interface_bring_down('wan', true); + } if (!is_array($config['interfaces']['wan'])) { $config['interfaces']['wan'] = array(); } @@ -420,6 +430,11 @@ EOD; } for ($i = 0; $i < count($optif); $i++) { + if (is_array($config['interfaces']['opt' . ($i+1)])) { + $upints = pfSense_interface_listget(IFF_UP); + if (in_array($config['interfaces']['opt' . ($i+1)]['if'], $upints)) + interface_bring_down('opt' . ($i+1), true); + } if (!is_array($config['interfaces']['opt' . ($i+1)])) { $config['interfaces']['opt' . ($i+1)] = array(); } |