diff options
author | Ermal <eri@pfsense.org> | 2013-01-24 10:24:26 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-01-24 10:24:26 +0000 |
commit | 9343d750bd2875b2f6a05c1c33b3928f23efcc83 (patch) | |
tree | 7dd61fbb934c0523fc30e2a13fbdfeb8edc414e9 /etc | |
parent | 203e4bb6253fd50cba66b64fbc5c605f95beacb5 (diff) | |
download | pfsense-9343d750bd2875b2f6a05c1c33b3928f23efcc83.zip pfsense-9343d750bd2875b2f6a05c1c33b3928f23efcc83.tar.gz |
Teach interface_bring_down to read a cofniguration passed in. Will be useful for Ticket #2758
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 1f17b73..7ff02df 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1070,7 +1070,7 @@ function interface_vip_bring_down($vip) { } } -function interface_bring_down($interface = "wan", $destroy = false) { +function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg = false) { global $config, $g; if (!isset($config['interfaces'][$interface])) @@ -1079,7 +1079,13 @@ function interface_bring_down($interface = "wan", $destroy = false) { if ($g['debug']) log_error("Calling interface down for interface {$interface}, destroy is " . (($destroy) ? 'true' : 'false')); - $ifcfg = $config['interfaces'][$interface]; + if ($ifacecfg === false) + $ifcfg = $config['interfaces'][$interface]; + else if (!is_array($ifacecfg)) + log_error(gettext("Wrong parameters used during interface_bring_down")); + else + $ifcfg = $ifacecfg; + $realif = get_real_interface($interface); |