Kill states associated with the old WAN IP when WAN IP has changed. Retain
hidden config option to wipe all states on IP change, as there seemed to be circumstances where the 'pfctl -k $oldip' didn't suffice for others (much of history in redmine ticket, some on forum and elsewhere). ticket
This commit is contained in:
parent
737b18f23b
commit
1ae41bfe84
|
@ -185,9 +185,12 @@ if(is_array($config['gifs']['gif'])){
|
|||
* could be failing back in which case we need to switch IPs back anyhow.
|
||||
*/
|
||||
if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interfaces'][$interface]['ipaddr'])) {
|
||||
/* option to flush state table on IP change */
|
||||
/* IP changed, kill states accordingly */
|
||||
if ($curwanip != $oldip) {
|
||||
log_error("IP has changed, killing states on former IP $oldip.");
|
||||
mwexec_bg("/sbin/pfctl -k $oldip");
|
||||
if (isset($config['system']['ip_change_kill_states'])) {
|
||||
/* hidden config option to wipe all states if needed */
|
||||
log_error("Killing all states post-IP change.");
|
||||
filter_flush_state_table();
|
||||
}
|
||||
|
|
Reference in New Issue