From a54890818d5d01e2bc0bdbc7b9db7ceb9e8a4b78 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 20 Nov 2005 04:44:07 +0000 Subject: [PATCH] Down all interfaces before reloading settings. Otherwise PF gets wacked out. --- etc/inc/pfsense-utils.inc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index a035c51c8d..b1f4c855c7 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1204,7 +1204,15 @@ function reload_interfaces_sync() { /* parse config.xml again */ $config = parse_config(true); - + + $iflist = array("lan" => "LAN"); + for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) + $iflist['opt' . $i] = $config['interfaces']['opt' . $i]['descr']; + foreach ($iflist as $ifent => $ifname) { + $ifname_real = convert_friendly_interface_to_real_interface_name($ifname); + mwexec("/sbin/ifconfig {$ifname_real} down"); + } + /* set up LAN interface */ interfaces_lan_configure(); @@ -1320,6 +1328,14 @@ function reload_all_sync() { /* generate resolv.conf */ system_resolvconf_generate(); + $iflist = array("lan" => "LAN"); + for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) + $iflist['opt' . $i] = $config['interfaces']['opt' . $i]['descr']; + foreach ($iflist as $ifent => $ifname) { + $ifname_real = convert_friendly_interface_to_real_interface_name($ifname); + mwexec("/sbin/ifconfig {$ifname_real} down"); + } + /* set up LAN interface */ interfaces_lan_configure();