summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-09-05 12:28:55 +0000
committerErmal <eri@pfsense.org>2013-09-05 12:28:55 +0000
commit19d723d2af5e8392d372720ef97b5b83336ec9e1 (patch)
tree71af78a81464b58c685035dd82d8117056027457 /etc
parent5aa44e98465dcdb4bde806b5c3cb0a16d30dcb5d (diff)
downloadpfsense-19d723d2af5e8392d372720ef97b5b83336ec9e1.zip
pfsense-19d723d2af5e8392d372720ef97b5b83336ec9e1.tar.gz
Ticket #3181 do the state flushing only on down gateway detection rather than any time.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc16
1 files changed, 5 insertions, 11 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 0656a56..dc8da4f 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -144,6 +144,7 @@ function filter_delete_states_for_down_gateways() {
if (isset($config['system']['kill_states']))
return;
+ $any_gateway_down = false;
$a_gateways = return_gateways_status();
if (is_array($GatewaysList)) {
foreach ($GatewaysList as $gwname => $gateway) {
@@ -157,20 +158,13 @@ function filter_delete_states_for_down_gateways() {
continue;
$gwstatus =& $a_gateways[$gateway['monitor']];
if (strstr($gwstatus['status'], "down")) {
- if (!empty($gateway['interface']))
- $gwiface = $gateway['interface'];
- else
- $gwiface = get_real_interface($gateway['friendlyiface']);
- $cmd = "/sbin/pfctl -i {$gwiface} -Fs";
- mwexec($cmd);
- $gwip = $gateway['gateway'];
- if (is_ipaddr($gwip)) {
- $cmd = "/sbin/pfctl -i {$gwiface} -Fs -G {$gwip}";
- mwexec($cmd);
- }
+ $any_gateway_down = true;
+ break;
}
}
}
+ if ($any_gateway_down == true)
+ mwexec("/sbin/pfctl -Fs");
}
/* reload filter sync */
OpenPOWER on IntegriCloud