diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-03-04 09:57:28 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-03-04 09:57:28 -0300 |
commit | e12ad49f4621ec9e99ca829c2d7188ad456638f8 (patch) | |
tree | d385d0a1ea9f6e75876b5c05037d23cf9accd1e7 /etc | |
parent | 4a7352101fbd6901b46a3b6a9a3c00d23b75f0e1 (diff) | |
download | pfsense-e12ad49f4621ec9e99ca829c2d7188ad456638f8.zip pfsense-e12ad49f4621ec9e99ca829c2d7188ad456638f8.tar.gz |
Save ppp info and realif on interfaces.apply to be able to cleanup old configuration when changing interface type. Fixes #2758
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/interfaces.inc | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 7b04fb2..c32758f 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1133,23 +1133,28 @@ function interface_bring_down($interface = "wan", $destroy = false, $ifacecfg = if ($g['debug']) log_error("Calling interface down for interface {$interface}, destroy is " . (($destroy) ? 'true' : 'false')); - if ($ifacecfg === false) + if ($ifacecfg === false) { $ifcfg = $config['interfaces'][$interface]; - else if (!is_array($ifacecfg)) + $ppps = $config['ppps']['ppp']; + $realif = get_real_interface($interface); + } elseif (!is_array($ifacecfg)) { log_error(gettext("Wrong parameters used during interface_bring_down")); - else - $ifcfg = $ifacecfg; - - - $realif = get_real_interface($interface); + } else { + $ifcfg = $ifacecfg['ifcfg']; + $ppps = $ifacecfg['ppps']; + if (isset($ifacecfg['ifcfg']['realif'])) + $realif = $ifacecfg['ifcfg']['realif']; + else + $realif = get_real_interface($interface); + } switch ($ifcfg['ipaddr']) { case "ppp": case "pppoe": case "pptp": case "l2tp": - if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { - foreach ($config['ppps']['ppp'] as $pppid => $ppp) { + if (is_array($ppps) && count($ppps)) { + foreach ($ppps as $pppid => $ppp) { if ($realif == $ppp['if']) { if (isset($ppp['ondemand']) && !$destroy){ send_event("interface reconfigure {$interface}"); |