feat(SystemNodeProvider): dismiss zero'd mac address (#468)

Co-authored-by: Ben Ramsey <ben@benramsey.com>
This commit is contained in:
zedar187
2022-12-19 22:30:41 +01:00
committed by GitHub
parent 5e24bfd390
commit 77e33bc7be
2 changed files with 19 additions and 4 deletions
+6 -3
View File
@@ -133,12 +133,15 @@ class SystemNodeProvider implements NodeProviderInterface
$ifconfig = (string) ob_get_clean();
$node = '';
if (preg_match_all(self::IFCONFIG_PATTERN, $ifconfig, $matches, PREG_PATTERN_ORDER)) {
$node = $matches[1][0] ?? '';
foreach ($matches[1] as $iface) {
if ($iface !== '00:00:00:00:00:00' && $iface !== '00-00-00-00-00-00') {
return $iface;
}
}
}
return $node;
return '';
}
/**