interfaces: use same approach as ppp-linkup script #5367

This commit is contained in:
Franco Fichtner 2021-11-26 10:27:11 +01:00
parent cc76580b16
commit a8522b7243

View File

@ -164,8 +164,8 @@ 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);
mwexecf('/sbin/pfctl -i %s -k 0.0.0.0/0 -k %s/32', [$interface_real, $cacheip]);
mwexecf('/sbin/pfctl -i %s -k %s/32 -k 0.0.0.0/0', [$interface_real, $cacheip]);
}
if (is_ipaddr($ip)) {