interfaces: fix two refactors and remove irrelevant XXX #4749

This commit is contained in:
Franco Fichtner 2021-09-15 21:23:04 +02:00
parent 4583c32ee7
commit 9335c87a6f
3 changed files with 3 additions and 6 deletions

View File

@ -3960,7 +3960,6 @@ function ip_in_interface_alias_subnet($interface, $ipalias)
function get_interface_ip($interface = 'wan', $ifconfig_details = null)
{
/* XXX maybe we should make a proper lookup */
if (strstr($interface, '_vip')) {
return get_configured_carp_interface_list($interface);
}
@ -3972,7 +3971,6 @@ function get_interface_ip($interface = 'wan', $ifconfig_details = null)
function get_interface_ipv6($interface = 'wan', $ifconfig_details = null)
{
/* XXX maybe we should make a proper lookup */
if (strstr($interface, '_vip')) {
return get_configured_carp_interface_list($interface, 'inet6');
}

View File

@ -175,9 +175,9 @@ function dpinger_configure_do($verbose = false, $gwname = null)
} elseif ($gateway['ipprotocol'] == "inet6") { // This is an IPv6 gateway...
if (is_linklocal($gateway['monitor'])) {
/* link local monitor needs a link local address for the "src" part */
$gwifip = interfaces_scoped_address6($gateway['if'], null, $ifconfig_details);
list ($gwifip) = interfaces_scoped_address6($gateway['if'], null, $ifconfig_details);
} else {
$gwifip = interfaces_primary_address6($gateway['if'], null, $ifconfig_details);
list ($gwifip) = interfaces_primary_address6($gateway['if'], null, $ifconfig_details);
}
if (empty($gwifip)) {

View File

@ -187,8 +187,7 @@ function carp_sync_xml($url, $username, $password, $sections, $debug)
foreach($transport_data['dhcpd'] as $dhcpif => $dhcpifconf) {
if (isset($dhcpifconf['failover_peerip']) && $dhcpifconf['failover_peerip'] != '') {
$int = guess_interface_from_ip($dhcpifconf['failover_peerip']);
$intip = interfaces_primary_address($int);
$transport_data['dhcpd'][$dhcpif]['failover_peerip'] = $intip;
$transport_data['dhcpd'][$dhcpif]['failover_peerip'] = get_interface_ip($int);
}
}
}