Project

General

Profile

« Previous | Next » 

Revision 1ae41bfe

Added by Chris Buechler almost 11 years ago

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

View differences:

etc/rc.newwanip
185 185
 * could be failing back in which case we need to switch IPs back anyhow.
186 186
 */
187 187
if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interfaces'][$interface]['ipaddr'])) {
188
	/* option to flush state table on IP change */
188
	/* IP changed, kill states accordingly */
189 189
	if ($curwanip != $oldip) {
190
		log_error("IP has changed, killing states on former IP $oldip.");
191
		mwexec_bg("/sbin/pfctl -k $oldip");
190 192
		if (isset($config['system']['ip_change_kill_states'])) {
193
			/* hidden config option to wipe all states if needed */
191 194
			log_error("Killing all states post-IP change.");
192 195
			filter_flush_state_table();
193 196
		}

Also available in: Unified diff