Revision c59dd719
Added by Ermal LUÇI almost 12 years ago
etc/inc/filter.inc | ||
---|---|---|
144 | 144 |
if (isset($config['system']['kill_states'])) |
145 | 145 |
return; |
146 | 146 |
|
147 |
$a_gateways = return_gateways_status(); |
|
148 |
if (is_array($GatewaysList)) { |
|
149 |
foreach ($GatewaysList as $gwname => $gateway) { |
|
150 |
if (empty($gateway['monitor'])) |
|
151 |
continue; |
|
152 |
if (!is_ipaddr($gateway['monitor'])) |
|
153 |
continue; |
|
154 |
if (strstr($gateway['monitor'], "127.0.0.")) |
|
155 |
continue; |
|
156 |
if (empty($a_gateways[$gateway['monitor']])) |
|
157 |
continue; |
|
158 |
$gwstatus =& $a_gateways[$gateway['monitor']]; |
|
159 |
if (strstr($gwstatus['status'], "down")) { |
|
160 |
if (!empty($gateway['interface'])) |
|
161 |
$gwiface = $gateway['interface']; |
|
162 |
else |
|
163 |
$gwiface = get_real_interface($gateway['friendlyiface']); |
|
164 |
$cmd = "/sbin/pfctl -i {$gwiface} -Fs"; |
|
165 |
mwexec($cmd); |
|
166 |
$gwip = $gateway['gateway']; |
|
167 |
if (is_ipaddr($gwip)) { |
|
168 |
$cmd = "/sbin/pfctl -i {$gwiface} -Fs -G {$gwip}"; |
|
169 |
mwexec($cmd); |
|
170 |
} |
|
171 |
} |
|
172 |
} |
|
173 |
} |
|
147 |
filter_flush_state_table(); |
|
174 | 148 |
} |
175 | 149 |
|
176 | 150 |
/* reload filter sync */ |
Also available in: Unified diff
Revert back the behaviour to cleanup all states for 2.1 Fixes #3181 and related to Ticket #1629. This commit is only for 2.1 since on master development will continue for better alternatives