Skip to content

Commit

Permalink
interfaces: loopback "lo0" exists for VIPs
Browse files Browse the repository at this point in the history
Historic oversight of wedging in a loopback interface in virtual IP
section while not making sure the actual configuration receives a
virtual IP when it needs to.  This was previously fixed by a batch
VIP regeneration in interfaces_configure() but we already saw that
this is not needed in 99% of the cases.

PR: https://forum.opnsense.org/index.php?topic=27547.0
  • Loading branch information
fichtner committed Mar 19, 2022
1 parent 0ac674c commit 9a618ba
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/etc/inc/interfaces.inc
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ function interfaces_loopback_configure($verbose = false)
}

legacy_interface_setaddress('lo0', '127.0.0.1');
interfaces_vips_configure('lo0');
legacy_interface_flags('lo0', 'up');

if ($verbose) {
Expand Down Expand Up @@ -1323,15 +1324,10 @@ EOD;
}
}

function interfaces_carp_setup($verbose = false)
function interfaces_carp_setup()
{
global $config;

if ($verbose) {
echo 'Configuring CARP settings...';
flush();
}

if (!empty($config['hasync']['pfsyncinterface'])) {
$carp_sync_int = get_real_interface($config['hasync']['pfsyncinterface']);
}
Expand All @@ -1353,10 +1349,6 @@ function interfaces_carp_setup($verbose = false)
} else {
mwexec('/sbin/ifconfig pfsync0 -syncdev -syncpeer down');
}

if ($verbose) {
echo "done.\n";
}
}

function interface_proxyarp_configure($interface = '')
Expand Down Expand Up @@ -1401,7 +1393,7 @@ function interface_proxyarp_configure($interface = '')
}
}

function interfaces_vips_configure($verbose = false, $interface = 'wan')
function interfaces_vips_configure($interface)
{
global $config;

Expand Down Expand Up @@ -1432,7 +1424,7 @@ function interfaces_vips_configure($verbose = false, $interface = 'wan')
}

if ($carp_setup) {
interfaces_carp_setup($verbose);
interfaces_carp_setup();
}

if ($anyproxyarp) {
Expand Down Expand Up @@ -2315,11 +2307,9 @@ function interface_configure($verbose = false, $interface = 'wan', $reload = fal
}
}

interfaces_vips_configure($interface);
interfaces_bring_up($realif);

/* always reconfigure VIPs since late boot configuration may need it too */
interfaces_vips_configure(false, $interface);

$gres = link_interface_to_gre($interface);
foreach ($gres as $gre) {
_interfaces_gre_configure($gre);
Expand Down

0 comments on commit 9a618ba

Please sign in to comment.