From 6607268a23a7fa467ffc156b8e4140cdb9c58b1d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 5 Jun 2023 08:39:29 +0200 Subject: [PATCH] interfaces: adjust this for moving it to stable safely While this should work let's try not to assume how the interface names look like and just match until the next known delimiter by excluding it and accepting all other characters. --- src/etc/inc/interfaces.lib.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/etc/inc/interfaces.lib.inc b/src/etc/inc/interfaces.lib.inc index e4573d0a3..eb46b4673 100644 --- a/src/etc/inc/interfaces.lib.inc +++ b/src/etc/inc/interfaces.lib.inc @@ -223,7 +223,7 @@ function legacy_interface_stats($ifs = null) $current_interface = ''; foreach ($out as $line) { - if (preg_match('/^Interface ([a-z0-9-_.:]+) \(([a-z]+[0-9]+)\):$/i', $line, $names)) { + if (preg_match('/^Interface ([^\s]+) \(([^\)]+)\):$/i', $line, $names)) { $stats[$names[1]] = [ 'device' => $names[1], 'driver' => $names[2],