-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed as not planned
Labels
blockedPRs that are blocked by other issues or PRs.PRs that are blocked by other issues or PRs.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.osIssues and PRs related to the os subsystem.Issues and PRs related to the os subsystem.stale
Description
Adoption of nodejs/node-v0.x-archive#9029.
os.networkInterfaces()
does not list all interfaces, but only those that have addresses, excluding for example an unplugged eth0
, which can be surprising.
This happens because os.networkInterfaces
is actually implemented in terms of GetInterfaceAddresses
which calls into uv_interface_addresses
(which among other things filters out everything except AF_INET*
) making networkInterfaces
a bit of a misnomer for what is basically networkInterfaceAddresses
.
Though os
is at stability 4 already, this behavior can be a bit unexpected. Perhaps we could correct it somewhat without breaking the API, or at least document it. I can think of a few ways to work this out:
- Leave the method as it is, but document the exceptional behavior in the docs, and leave it to a community module to solve this correctly; or
- Alias it to
os.networkInterfaceAddresses
, thus reflectingGetInterfaceAddresses
anduv_interface_addresses
; or - Implement
uv_interfaces
and rebaseos.networkInterfaces()
on that anduv_interface_addresses
, preserving the current behavior, but listing all interfaces when given a flag.
- yes
- os
- v0.10, v0.12, v1.0.0
tajnymag
Metadata
Metadata
Assignees
Labels
blockedPRs that are blocked by other issues or PRs.PRs that are blocked by other issues or PRs.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.osIssues and PRs related to the os subsystem.Issues and PRs related to the os subsystem.stale