From 24f100366ff7c392e5e141802e272e912ef8fafc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 13 Feb 2022 10:50:05 +0100 Subject: [PATCH] interfaces: nothing requires all vips to be regenerated #5540 The side effect from this may be that VIPs disappear from disabled interfaces which is how it should have been. Furthermore, remove the configuration of vips from rc.newwanip which was added for unknown reasons in pfSense a long time ago and got also copied to rc.newwanipv6 for us during cleanups but never in pfSense. Especially since we removed find_interface_*() function family we never risk reading an alias as a primary address and for all intents and purposes an alias should never appear from an interface except it was stripped in error by faulty code. Win-win really. ;) --- src/etc/inc/interfaces.inc | 4 ++-- src/etc/rc.newwanip | 2 -- src/etc/rc.newwanipv6 | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 45aa6fa9f..5da0f5db1 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -1388,7 +1388,7 @@ function interface_proxyarp_configure($interface = '') } } -function interfaces_vips_configure($verbose = false, $interface = '') +function interfaces_vips_configure($verbose = false, $interface = 'wan') { global $config; @@ -1400,7 +1400,7 @@ function interfaces_vips_configure($verbose = false, $interface = '') $anyproxyarp = false; foreach ($config['virtualip']['vip'] as $vip) { - if (empty($interface) || $vip['interface'] == $interface) { + if ($vip['interface'] == $interface) { switch ($vip['mode']) { case 'proxyarp': $anyproxyarp = true; diff --git a/src/etc/rc.newwanip b/src/etc/rc.newwanip index 10ab939e0..4fa3056cf 100755 --- a/src/etc/rc.newwanip +++ b/src/etc/rc.newwanip @@ -75,8 +75,6 @@ if (!is_ipaddr($ip) && substr($interface_real, 0, 4) != 'ovpn') { return; } -interfaces_vips_configure(false, $interface); - $gres = link_interface_to_gre($interface); foreach ($gres as $gre) { _interfaces_gre_configure($gre); diff --git a/src/etc/rc.newwanipv6 b/src/etc/rc.newwanipv6 index c49f5c5f9..c9fbd49a7 100755 --- a/src/etc/rc.newwanipv6 +++ b/src/etc/rc.newwanipv6 @@ -75,8 +75,6 @@ if (!is_ipaddr($ip) && substr($interface_real, 0, 4) != 'ovpn') { return; } -interfaces_vips_configure(false, $interface); - if (count(link_interface_to_track6($interface, true))) { plugins_configure('dhcp', false, array('inet6')); }