summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-04-10 20:28:59 +0700
committergnhb <gnoahb@gmail.com>2010-04-10 20:28:59 +0700
commit73ee49f20460fe724258153aabcd61be8bc4f52f (patch)
treeac9ffe1f6999ce311eb7b890d6c07496fac9304f /etc
parent673d29c002b54d8a415e604cd2b14f6bc4ec845f (diff)
downloadpfsense-73ee49f20460fe724258153aabcd61be8bc4f52f.zip
pfsense-73ee49f20460fe724258153aabcd61be8bc4f52f.tar.gz
Rework interface_bring_down function a bit. Remove un-needed unlink calls to mpd.links
Moved three "unlink_if_exists" calls to happen after calling kill_by_pid for mpd processes. The unlinked files are useful during the process of brining down the mpd interfaces for calculating the link uptime in the "linkdown" script.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc15
1 files changed, 7 insertions, 8 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 65e3996..9dc9f9b 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -816,24 +816,16 @@ function interface_bring_down($interface = "wan", $destroy = false) {
$realif = get_real_interface($interface);
-
- /* remove interface up file if it exists */
- unlink_if_exists("{$g['tmp_path']}/{$realif}up");
- unlink_if_exists("{$g['vardb_path']}/{$interface}ip");
- unlink_if_exists("{$g['tmp_path']}/{$realif}_router");
-
switch ($ifcfg['ipaddr']) {
case "pppoe":
killbypid("{$g['varrun_path']}/pppoe_{$interface}.pid");
sleep(2);
unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf");
- unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.links");
break;
case "pptp":
killbypid("{$g['varrun_path']}/pptp_{$interface}.pid");
sleep(2);
unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf");
- unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.links");
break;
case "carpdev-dhcp":
/*
@@ -854,6 +846,8 @@ function interface_bring_down($interface = "wan", $destroy = false) {
break;
case "ppp":
killbypid("{$g['varrun_path']}/ppp_{$interface}.pid");
+ sleep(2);
+ unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf");
break;
default:
if(does_interface_exist("$realif")) {
@@ -864,6 +858,11 @@ function interface_bring_down($interface = "wan", $destroy = false) {
break;
}
+ /* remove interface up file if it exists */
+ unlink_if_exists("{$g['tmp_path']}/{$realif}up");
+ unlink_if_exists("{$g['vardb_path']}/{$interface}ip");
+ unlink_if_exists("{$g['tmp_path']}/{$realif}_router");
+
/* hostapd and wpa_supplicant do not need to be running when the interface is down.
* They will also use 100% CPU if running after the wireless clone gets deleted. */
if (is_array($ifcfg['wireless'])) {
OpenPOWER on IntegriCloud