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:29:21 +0000
commit36fa13a632bad73fb2a8fdc2e9627e3190ea63c6 (patch)
tree499949be52ead7694f098fb1297e1d69d91766a4 /etc
parent0b18ef0581b83faab685e3c241b897d31060a3d3 (diff)
downloadpfsense-36fa13a632bad73fb2a8fdc2e9627e3190ea63c6.zip
pfsense-36fa13a632bad73fb2a8fdc2e9627e3190ea63c6.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 8139a00..41f5985 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