diff options
author | Renato Botelho <renato@netgate.com> | 2015-12-29 10:19:05 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-12-29 10:19:05 -0200 |
commit | 3a335f0798cae05f86d61a43148fd0efc83408d7 (patch) | |
tree | 363df51e72a967422b9b79366f51137c23586138 /src/etc/inc/gwlb.inc | |
parent | b42177b9881fea3e7c862c912e314474bf28f127 (diff) | |
download | pfsense-3a335f0798cae05f86d61a43148fd0efc83408d7.zip pfsense-3a335f0798cae05f86d61a43148fd0efc83408d7.tar.gz |
Collect dpinger processes that failed to start and try again after 1 second, this should be enough to fix #5711
Diffstat (limited to 'src/etc/inc/gwlb.inc')
-rw-r--r-- | src/etc/inc/gwlb.inc | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc index e543f3e..c36a026 100644 --- a/src/etc/inc/gwlb.inc +++ b/src/etc/inc/gwlb.inc @@ -286,9 +286,32 @@ function setup_gateways_monitor() { stop_dpinger(); /* Start new processes */ + $failed = array(); foreach ($gateways_arr as $gateway) { - if (isset($gateway['enable_dpinger'])) { - start_dpinger($gateway); + if (!isset($gateway['enable_dpinger'])) { + continue; + } + + if (start_dpinger($gateway) != 0) { + /* + * Save process didn't start and try + * again later + */ + $failed[] = $gateway['name']; + } + } + + if (!empty($failed)) { + /* 1 second is enough for IPv6 DAD to finish */ + sleep(1); + foreach ($gateways_arr as $gateway) { + if (!in_array($gateway['name'], $failed)) { + continue; + } + if (start_dpinger($gateway) != 0) { + log_error("Error starting gateway monitor " . + "for {$gateway['name']}"); + } } } |