summaryrefslogtreecommitdiffstats
path: root/etc/inc/interfaces.inc
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2011-01-03 20:18:24 +0700
committergnhb <gnoahb@gmail.com>2011-01-03 20:18:24 +0700
commitc8d23069345a11029fe0a2dac897449b9e07f100 (patch)
tree1c1bcdc2814fe16438499eed364491810916614c /etc/inc/interfaces.inc
parent1edfb2de94a09dc0d56f4e4453553f06c948a84a (diff)
downloadpfsense-c8d23069345a11029fe0a2dac897449b9e07f100.zip
pfsense-c8d23069345a11029fe0a2dac897449b9e07f100.tar.gz
Reshuffle code a bit. Prevent potential race condition between one mpd instance
shutting down and the second one starting. There's no need to kill mpd before restarting it since we always start it with the "-k" flag which means "wait for existing mpd process to exit gracefully before starting."
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r--etc/inc/interfaces.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 0a5e00a..d0ff066 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -917,13 +917,15 @@ function interface_bring_down($interface = "wan", $destroy = false) {
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
if ($realif == $ppp['if']) {
+ if (isset($ppp['ondemand']) && !$destroy){
+ send_event("interface reconfigure {$interface}");
+ break;
+ }
if (file_exists("{$g['varrun_path']}/{$ppp['type']}_{$interface}.pid")) {
killbypid("{$g['varrun_path']}/{$ppp['type']}_{$interface}.pid");
- sleep(5);
+ sleep(2);
}
unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf");
- if (isset($ppp['ondemand']) && !$destroy)
- send_event("interface reconfigure {$interface}");
break;
}
}
OpenPOWER on IntegriCloud