networkInterfaces loopback internal detection (windows)

This commit is contained in:
Sebastian Hildebrandt 2020-10-13 14:31:46 +02:00
parent e756186225
commit 7c29461b58
2 changed files with 5 additions and 2 deletions

View File

@ -30,7 +30,7 @@
[![Sponsoring][sponsor-badge]][sponsor-url] [![Sponsoring][sponsor-badge]][sponsor-url]
[![MIT license][license-img]][license-url] [![MIT license][license-img]][license-url]
This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 300 versions published, > 1 mio downloads per month, > 15 mio downloads overall. Thank you to all who contributed to this project! This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 300 versions published, up to 2 mio downloads per month, > 18 mio downloads overall. Thank you to all who contributed to this project!
## New Version 4.0 ## New Version 4.0

View File

@ -884,7 +884,10 @@ function networkInterfaces(callback, rescan = true) {
ieee8021xAuth = IEEE8021x.protocol; ieee8021xAuth = IEEE8021x.protocol;
ieee8021xState = IEEE8021x.state; ieee8021xState = IEEE8021x.state;
} }
let internal = (ifaces[dev] && ifaces[dev][0]) ? ifaces[dev][0].internal : !!(dev.toLowerCase().indexOf('loopback') > -1 || ifaceName.toLowerCase().indexOf('loopback') > -1); let internal = (ifaces[dev] && ifaces[dev][0]) ? ifaces[dev][0].internal : false;
if (dev.toLowerCase().indexOf('loopback') > -1 || ifaceName.toLowerCase().indexOf('loopback') > -1) {
internal = true;
}
const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac); const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac);
result.push({ result.push({
iface: dev, iface: dev,