networkInterfaces loopback internal detection (windows)
This commit is contained in:
parent
35d835b61e
commit
e756186225
@ -451,7 +451,7 @@ function parseLinesDarwinNics(sections) {
|
||||
if (isNaN(nic.mtu)) {
|
||||
nic.mtu = -1;
|
||||
}
|
||||
nic.internal = parts[0].indexOf('LOOPBACK') > -1;
|
||||
nic.internal = parts[0].toLowerCase().indexOf('loopback') > -1;
|
||||
section.forEach(line => {
|
||||
if (line.trim().startsWith('ether ')) {
|
||||
nic.mac = line.split('ether ')[1].toLowerCase().trim();
|
||||
@ -586,13 +586,13 @@ function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {
|
||||
|
||||
let dhcStatus = resultFormat.split(' ').slice(1).toString();
|
||||
switch (dhcStatus) {
|
||||
case 'auto':
|
||||
result = true;
|
||||
break;
|
||||
case 'auto':
|
||||
result = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
} catch (e) {
|
||||
@ -884,7 +884,7 @@ function networkInterfaces(callback, rescan = true) {
|
||||
ieee8021xAuth = IEEE8021x.protocol;
|
||||
ieee8021xState = IEEE8021x.state;
|
||||
}
|
||||
let internal = (ifaces[dev] && ifaces[dev][0]) ? ifaces[dev][0].internal : null;
|
||||
let internal = (ifaces[dev] && ifaces[dev][0]) ? ifaces[dev][0].internal : !!(dev.toLowerCase().indexOf('loopback') > -1 || ifaceName.toLowerCase().indexOf('loopback') > -1);
|
||||
const virtual = internal ? false : testVirtualNic(dev, ifaceName, mac);
|
||||
result.push({
|
||||
iface: dev,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user