interfaces: make rc.newwanipv6 more clever...

... since b8a3c3dd3f6c can mimic the behaviour of get_interface_ipv6()
we can now call interfaces_primary_address6() instead of the less
educated find_interface_ipv6*() equivalents.

Probably quite some people with WAN aliases run into this issue where
renewal doesn't work because rc.newwanipv6 latches on to the VIP instead
of the primary address.
This commit is contained in:
Franco Fichtner 2020-04-11 11:22:21 +02:00
parent 08fc36a327
commit 9904a1da4c
2 changed files with 4 additions and 5 deletions

View File

@ -3983,10 +3983,9 @@ function get_interface_ipv6($interface = 'wan', $ifconfig_details = null)
return get_configured_carp_interface_list($interface, 'inet6');
}
$realif = get_real_interface($interface, 'inet6');
list ($ipv6) = interfaces_primary_address6($interface, null, $ifconfig_details);
return isset($config['interfaces'][$interface]['dhcp6prefixonly']) ?
find_interface_ipv6_ll($realif, $ifconfig_details) : find_interface_ipv6($realif, $ifconfig_details);
return $ipv6;
}
/****f* interfaces/is_interface_wireless

View File

@ -50,13 +50,13 @@ log_error("IP renewal is starting on '{$argument}'");
if (empty($argument)) {
$interface = 'wan';
$interface_real = get_real_interface($interface, 'inet6');
$ip = get_interface_ipv6($interface);
} else {
$interface = convert_real_interface_to_friendly_interface_name($argument);
$interface_real = $argument;
$ip = get_interface_ipv6($interface);
}
$ip = get_interface_ipv6($interface);
if (!isset($config['interfaces'][$interface]['enable'])) {
log_error("Interface '{$interface}' is disabled or empty, nothing to do.");
return;