rc.newwanip[v6] - only reconfigure an interface if it's either a non static non dhcp[6] variant or the address has changed.

It might be possible to skip the whole !is_ipaddr(), but the side affects aren't fully clear hence the != dhcp[6] to ease implementation.
Before this commit, dhcp[6] interfaces always tried to reconfigure, which makes the whole comparison quite useless.

related to https://github.com/opnsense/core/issues/5624
This commit is contained in:
Ad Schellevis 2022-03-16 20:16:35 +01:00
parent 10e6759ab6
commit 8c49c7bfdd
2 changed files with 4 additions and 2 deletions

View File

@ -146,8 +146,9 @@ ifgroup_setup();
$cacheip_file = "/tmp/{$interface_real}_oldip";
$cacheip = trim(@file_get_contents($cacheip_file));
$intf_ipaddr = $config['interfaces'][$interface]['ipaddr'];
if ($ip != $cacheip || !is_ipaddr($config['interfaces'][$interface]['ipaddr'])) {
if ($ip != $cacheip || (!is_ipaddr($intf_ipaddr) && $intf_ipaddr != 'dhcp')) {
system_routing_configure(false, $interface);
plugins_configure('monitor');
filter_configure_sync();

View File

@ -84,8 +84,9 @@ system_hosts_generate();
$cacheip_file = "/tmp/{$interface_real}_oldipv6";
$cacheip = trim(@file_get_contents($cacheip_file));
$intf_ipaddr = $config['interfaces'][$interface]['ipaddrv6'];
if ($ip != $cacheip || !is_ipaddr($config['interfaces'][$interface]['ipaddrv6'])) {
if ($ip != $cacheip || (!is_ipaddr($intf_ipaddr) && $intf_ipaddr != 'dhcp6')) {
if ($ip == $cacheip) {
if (in_array($config['interfaces'][$interface]['ipaddr'], array('l2tp', 'ppp', 'pppoe', 'pptp'))) {
/* PPP reconnect loop avoidance */