From 10e022c05c8b3bfefc0615190887958bd9a13ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robbert=20M=C3=BCller?= Date: Wed, 18 Oct 2017 10:32:45 +0200 Subject: [PATCH] bug fixes - add missing default value - invert logic, because it was doing it the wrong way around --- src/Provider/Node/SystemNodeProvider.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Provider/Node/SystemNodeProvider.php b/src/Provider/Node/SystemNodeProvider.php index 507948c..3780d5d 100644 --- a/src/Provider/Node/SystemNodeProvider.php +++ b/src/Provider/Node/SystemNodeProvider.php @@ -39,11 +39,11 @@ class SystemNodeProvider implements NodeProviderInterface $matches = array(); // first try a linux specific way - $node = $this->getsysfs(); + // Search the ifconfig output for all MAC addresses and return // the first one found - if ($node !== false) { + if ($node === false) { if (preg_match_all($pattern, $this->getIfconfig(), $matches, PREG_PATTERN_ORDER)) { $node = $matches[1][0]; } @@ -86,6 +86,7 @@ class SystemNodeProvider implements NodeProviderInterface */ protected function getsysfs() { + $mac = false; if (strtoupper(php_uname('s')) === "LINUX") { // get all the macadresses of all systems $macs = array_map(