diff options
author | Ermal <eri@pfsense.org> | 2010-06-10 16:59:56 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-06-10 17:00:12 +0000 |
commit | 315e1253f624c8a348385b85560659c2def02aeb (patch) | |
tree | fa1e1a0ccc76411ec2ea9ea841bf77649aca4dc9 /etc | |
parent | 3b15d9248700922aeac69b98fbb0fc743ea0551c (diff) | |
download | pfsense-315e1253f624c8a348385b85560659c2def02aeb.zip pfsense-315e1253f624c8a348385b85560659c2def02aeb.tar.gz |
Do not delete/create a route for a gateway that is marked as down to avoid removing needed routes to check teh gateways. Reported-by: http://forum.pfsense.org/index.php/topic,25854.0.html
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/gwlb.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 11c57c6..20f049c 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -37,6 +37,7 @@ function setup_gateways_monitor() { global $config; global $g; $gateways_arr = return_gateways_array(); + $gateways_status = return_gateways_status(); if (!is_array($config['gateways']['gateway_item'])) $config['gateways']['gateway_item'] = array(); @@ -216,7 +217,9 @@ EOD; * route as this will break the routing table */ continue; } else { - if(($gateway['gateway'] != "dynamic") && (is_ipaddr($gateway['gateway']))) { + if (!empty($gateway_status[$gateway['monitor']]) && $gateway_status[$gateway['monitor']]['status'] == "down") + ; /* This check makes sure that we do not delete previous routes. */ + else if ($gateway['gateway'] != "dynamic" && is_ipaddr($gateway['gateway'])) { mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor'])); mwexec("/sbin/route add -host " . escapeshellarg($gateway['monitor']) . " " . escapeshellarg($gateway['gateway'])); @@ -527,4 +530,4 @@ function get_interface_gateway($interface, &$dynamic = false) { return ($gw); } -?>
\ No newline at end of file +?> |