Skip to content

Commit

Permalink
interfaces: avoid touching cacheip files and improve state kill #5367
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Nov 23, 2021
1 parent 671ebdd commit 028302a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/etc/inc/interfaces.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1116,8 +1116,7 @@ function interface_bring_down($interface = "wan", $ifacecfg = false)
/* clear stale state files associated with this interface */
@unlink("/var/db/{$interface}_ip");
@unlink("/var/db/{$interface}_ipv6");
@unlink("/var/db/{$interface}_cacheip");
@unlink("/var/db/{$interface}_cacheipv6");
/* do not unlink cacheip(v6) variants for state kill in rc.newwanip(v6) scripts */
@unlink("/var/etc/nameserver_{$realif}");
@unlink("/var/etc/nameserver_v6{$realifv6}");
@unlink("/var/etc/searchdomain_{$realif}");
Expand Down
1 change: 1 addition & 0 deletions src/etc/rc.newwanip
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ if (!is_ipaddr($cacheip) || $ip != $cacheip || !is_ipaddr($configip)) {
mwexec('/sbin/pfctl -Fs');
} else if (is_ipaddr($cacheip) && $ip != $cacheip) {
log_error("IP address change detected, killing states of old ip $cacheip");
mwexecf('/sbin/pfctl -k 0.0.0.0/0 -k %s', $cacheip);
mwexecf('/sbin/pfctl -k %s', $cacheip);
}

Expand Down

0 comments on commit 028302a

Please sign in to comment.