From 29e6e12d7c6a2a93d0bc227b74e0ef56ce76c98a Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 17 Aug 2022 07:36:48 +0200 Subject: [PATCH] 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. --- src/etc/inc/system.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index ffa94d0f0..3674abedd 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -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; }