mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
interfaces: according to #5646 VIP reassignment enforces "order"
This is strange, but no the strangest thing to happen. Partially restore the old functionality but this time make sure we only flip IPv4 on IPv4 and IPv6 on IPv6 changes instead of everything all the time.
This commit is contained in:
parent
2e747acda9
commit
57097e20ac
@ -1395,7 +1395,7 @@ function interface_proxyarp_configure($interface = '')
|
||||
}
|
||||
}
|
||||
|
||||
function interfaces_vips_configure($interface)
|
||||
function interfaces_vips_configure($interface, $family = null)
|
||||
{
|
||||
global $config;
|
||||
|
||||
@ -1407,21 +1407,27 @@ function interfaces_vips_configure($interface)
|
||||
$anyproxyarp = false;
|
||||
|
||||
foreach ($config['virtualip']['vip'] as $vip) {
|
||||
if ($vip['interface'] == $interface) {
|
||||
switch ($vip['mode']) {
|
||||
case 'proxyarp':
|
||||
$anyproxyarp = true;
|
||||
break;
|
||||
case 'ipalias':
|
||||
interface_ipalias_configure($vip);
|
||||
break;
|
||||
case 'carp':
|
||||
if (!$carp_setup) {
|
||||
$carp_setup = true;
|
||||
}
|
||||
interface_carp_configure($vip);
|
||||
break;
|
||||
}
|
||||
if ($vip['interface'] != $interface) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($family === 4 && strpos($vip['subnet'], ':') !== false) {
|
||||
continue;
|
||||
} elseif ($family === 6 && strpos($vip['subnet'], ':') === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch ($vip['mode']) {
|
||||
case 'proxyarp':
|
||||
$anyproxyarp = true;
|
||||
break;
|
||||
case 'ipalias':
|
||||
interface_ipalias_configure($vip);
|
||||
break;
|
||||
case 'carp':
|
||||
$carp_setup = true;
|
||||
interface_carp_configure($vip);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -75,6 +75,8 @@ if (!is_ipaddr($ip) && substr($interface_real, 0, 4) != 'ovpn') {
|
||||
return;
|
||||
}
|
||||
|
||||
interfaces_vips_configure($interface, 4);
|
||||
|
||||
$gres = link_interface_to_gre($interface);
|
||||
foreach ($gres as $gre) {
|
||||
_interfaces_gre_configure($gre);
|
||||
|
||||
@ -75,6 +75,8 @@ if (!is_ipaddr($ip) && substr($interface_real, 0, 4) != 'ovpn') {
|
||||
return;
|
||||
}
|
||||
|
||||
interfaces_vips_configure($interface, 6);
|
||||
|
||||
if (count(link_interface_to_track6($interface, true))) {
|
||||
plugins_configure('dhcp', false, array('inet6'));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user