system: deal with ifctl internals for now #5933

Later we want ifctl to add the scope to the link-local gateway
by default which will remove a more code, but for now we are
bound to undo the internal magic.

Interface name stops with first ":" or last "_".  For the exclude
check use the correct array index, not the array itself.
This commit is contained in:
Franco Fichtner 2022-08-17 07:36:48 +02:00
parent 92a5a224dd
commit 29e6e12d7c

View File

@ -363,10 +363,13 @@ function get_nameservers($interface = null, $with_gateway = false)
foreach ($dns_lists as $fdns) {
/* inspect dynamic servers registered in the system files */
$intf = [];
$intf[0] = preg_replace('/_[^_]+$/', '', basename($fdns));
/* XXX this is ifctl logic we eventually need to pass down */
$intf[0] = preg_replace('/(_[^_]+|:.+)$/', '', basename($fdns));
$intf[1] = preg_replace('/^.+_/', '', basename($fdns));
$intf[1] = strpos($intf[1], 'v6') === false ? '4' : '6';
if (in_array($intf, $exclude_interfaces)) {
if (in_array($intf[0], $exclude_interfaces)) {
continue;
}