From fd205068567b25ccacf5412d2018c5748764a11a Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Fri, 9 Apr 2021 07:34:46 +0200 Subject: [PATCH] networkInterfaces() windows detection fix --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 6 +++--- lib/network.js | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7553367..847c9b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 5.6.12 | 2021-04-09 | `networkinterfaces()` windows detection fix | | 5.6.11 | 2021-04-08 | `versions()` parameter sanitation | | 5.6.10 | 2021-03-29 | `vboxInfo()` fixed windows bug | | 5.6.9 | 2021-03-28 | `graphics()` fixed nvidia-smi compare bug | diff --git a/docs/history.html b/docs/history.html index 8cff1fb..1dcabcb 100644 --- a/docs/history.html +++ b/docs/history.html @@ -56,6 +56,11 @@ + + 5.6.12 + 2021-04-09 + networkInterfaces() windows detection fix + 5.6.11 2021-04-08 diff --git a/docs/index.html b/docs/index.html index a6b5c55..5d33c09 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.6.11
+
New Version: 5.6.12
@@ -203,7 +203,7 @@
-
14,225
+
14,231
Lines of code
@@ -211,7 +211,7 @@
Downloads last month
-
407
+
410
Dependents
diff --git a/lib/network.js b/lib/network.js index 0dc8d9e..60034fd 100644 --- a/lib/network.js +++ b/lib/network.js @@ -874,14 +874,16 @@ function networkInterfaces(callback, rescan = true) { dnsSuffix = getWindowsIfaceDNSsuffix(dnsSuffixes.ifaces, dev); + let foundFirst = false; nics.forEach(detail => { - if (detail.mac === mac) { + if (detail.mac === mac && !foundFirst) { iface = detail.iface || iface; ifaceName = detail.name; dhcp = detail.dhcp; operstate = detail.operstate; speed = detail.speed; type = detail.type; + foundFirst = true; } });