Skip to content

Commit

Permalink
More identifiers for possible network interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
scravy committed May 4, 2020
1 parent 0eb0bdc commit 27054c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ lib.networkInterfaces = function () {
try {
var ifaces = os.networkInterfaces();
} catch (e) {
// At October 2016 WSL does not support os.networkInterfaces() and throws
// Return empty object as if no interfaces were found
// https://github.com/Microsoft/BashOnWindows/issues/468
// At October 2016 WSL does not support os.networkInterfaces() and throws
// Return empty object as if no interfaces were found
// https://github.com/Microsoft/BashOnWindows/issues/468
if (e.syscall === 'uv_interface_addresses') {
return allAddresses;
} else {
Expand Down Expand Up @@ -107,7 +107,7 @@ lib.one = function (iface, callback) {
callback = iface;

var ifaces = lib.networkInterfaces();
var alleged = [ 'eth0', 'eth1', 'en0', 'en1' ];
var alleged = [ 'eth0', 'eth1', 'en0', 'en1', 'en2', 'en3', 'en4' ];
iface = Object.keys(ifaces)[0];
for (var i = 0; i < alleged.length; i++) {
if (ifaces[alleged[i]]) {
Expand Down

0 comments on commit 27054c5

Please sign in to comment.