Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.networkInterfaces() returns wrong result #5629

Closed
pavelzaruba opened this issue Mar 9, 2016 · 12 comments
Closed

os.networkInterfaces() returns wrong result #5629

pavelzaruba opened this issue Mar 9, 2016 · 12 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. os Issues and PRs related to the os subsystem. windows Issues and PRs related to the Windows platform.

Comments

@pavelzaruba
Copy link

The following code...

console.log(require('os').networkInterfaces());

...shows list of network interfaces. It includes e.g. Ethernet adapters, Tunnel adapters, but not Wireless LAN adapters. So it differs from ipconfig /all shell command.

The second difference is that the tunnel adapter physical address returned by ipconfig /all command is "00-00-00-00-00-00-00-E0" but networkinterfaces() returns "00-00-00-00-00-00".

  • Version: 0.12.7
  • Platform: Windows 10 64-bit
@Fishrock123 Fishrock123 added the os Issues and PRs related to the os subsystem. label Mar 9, 2016
@brendanashworth brendanashworth added the windows Issues and PRs related to the Windows platform. label Mar 10, 2016
@brendanashworth
Copy link
Contributor

@pavelzaruba hi there! Perhaps you could take a look at #498? That may be similar to the first problem.

For the second problem, would you mind trying the same with a more recent node version (v5)? It may have already been fixed and may just need a backport. Thanks!

@pavelzaruba
Copy link
Author

@brendanashworth hi! So it just lists interfaces with assigned address according the link. I expected that it enumerates all the network interfaces. Then it is useless for me. Does anybody use it for something?

The second issue is still there in Node v5.8.0.

@brendanashworth
Copy link
Contributor

I think that's correct, as it's also in the docs:

Note that due to the underlying implementation this will only return network interfaces that have been assigned an address.

I'm sorry if it doesn't fit your use case. Perhaps cc @nodejs/platform-windows ?

@jasnell
Copy link
Member

jasnell commented Apr 12, 2016

Is this a duplicate of #498

@jasnell
Copy link
Member

jasnell commented Apr 12, 2016

is there reason to keep this open?

@Fishrock123 Fishrock123 added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Apr 12, 2016
@Fishrock123
Copy link
Member

reopen if necessary :)

@pavelzaruba
Copy link
Author

What about the second issue?

@bnoordhuis
Copy link
Member

You mean this?

The second difference is that the tunnel adapter physical address returned by ipconfig /all command is "00-00-00-00-00-00-00-E0" but networkinterfaces() returns "00-00-00-00-00-00".

I'm guessing that it's a EUI-64 MAC address but libuv (and therefore node.js) only supports MAC-48. Libuv v1.x can't easily add support for EUI-64 because that would break ABI (because it changes sizeof(uv_interface_address_t).)

@bnoordhuis
Copy link
Member

I filed libuv/libuv#829 for that, by the way.

@pavelzaruba
Copy link
Author

You mean this?

Yes I do.
Thanks.

@XadillaX
Copy link
Contributor

I've created a PR for this bug in libuv. After that PR done, we can upgrade libuv in Node.js.

@refack
Copy link
Contributor

refack commented Jun 10, 2017

Cross-Ref: libuv/libuv#1375

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. os Issues and PRs related to the os subsystem. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

7 participants