diff options
author | Ermal <eri@pfsense.org> | 2010-08-10 20:47:03 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-08-10 20:49:40 +0000 |
commit | 79b7f49845b0b7efebd9fbc1cbb84456d6a47b93 (patch) | |
tree | b3bd6a794b058b82846a823f92ea8a23c10546b8 | |
parent | cdad3139803d36c5fbdced07d368235d5d13773d (diff) | |
download | pfsense-79b7f49845b0b7efebd9fbc1cbb84456d6a47b93.zip pfsense-79b7f49845b0b7efebd9fbc1cbb84456d6a47b93.tar.gz |
Ticket #8. Use proper IP to pfctl -b and run the command after the rules have been removed for the not 'down' interfaces.
-rw-r--r-- | etc/inc/filter.inc | 5 | ||||
-rw-r--r-- | etc/inc/gwlb.inc | 11 |
2 files changed, 8 insertions, 8 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 3a6c37a..5fe9cfb 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -146,9 +146,8 @@ function filter_delete_states_for_down_gateways() { $a_gateways = return_gateways_status(); foreach ($a_gateways as $gateway) { if (stristr($status['status'], "down")) { - $int_ip = get_interface_ip($gateway['interface']); - if (is_ipaddr($int_ip)) - mwexec("/sbin/pfctl -b {$int_ip}"); + if (is_ipaddr($gateway['srcip'])) + mwexec("/sbin/pfctl -b {$gateway['srcip']}"); } } } diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index f574d8e..4a9decb 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -267,11 +267,12 @@ function return_gateways_status() { foreach($apingerstatus as $line) { $info = explode("|", $line); $target = $info[0]; - $status[$target]['name'] = $info[1]; - $status[$target]['lastcheck'] = $info[4] ? date('r', $info[4]) : date('r'); - $status[$target]['delay'] = empty($info[5]) ? 0 : $info[5]; - $status[$target]['loss'] = empty($info[6]) ? "0.0%" : $info[6] . ""; - $status[$target]['status'] = trim($info[7]); + $status[$target]['srcip'] = $info[1]; + $status[$target]['name'] = $info[2]; + $status[$target]['lastcheck'] = $info[5] ? date('r', $info[5]) : date('r'); + $status[$target]['delay'] = empty($info[6]) ? 0 : $info[6]; + $status[$target]['loss'] = empty($info[7]) ? "0.0%" : $info[7] . ""; + $status[$target]['status'] = trim($info[8]); } return($status); } |