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

CIDR support for os.networkInterfaces #14006

Closed
silverwind opened this issue Jun 30, 2017 · 1 comment
Closed

CIDR support for os.networkInterfaces #14006

silverwind opened this issue Jun 30, 2017 · 1 comment
Labels
feature request Issues that request new features to be added to Node.js. os Issues and PRs related to the os subsystem.

Comments

@silverwind
Copy link
Contributor

silverwind commented Jun 30, 2017

os.networkInterfaces currently returns IP addresses and netmasks in the old-fashioned format of separate address and netmask:

{ address: '127.0.0.1',
  netmask: '255.0.0.0' }
{ address: '2001:db8::',
  netmask: 'ffff:ffff:ffff:ffff::' }

It's very uncommon to specify a IPv6 subnet mask like above. I think it'd generally be easier for users to work with these addresses if they were also available in CIDR form, maybe via a new cidr property, e.g. '127.0.0.1/8' and '2001:db8::/64'.

@addaleax addaleax added feature request Issues that request new features to be added to Node.js. os Issues and PRs related to the os subsystem. labels Jun 30, 2017
@zeusdeux zeusdeux mentioned this issue Jul 16, 2017
4 tasks
@zeusdeux
Copy link
Contributor

PR-ed here.

refack pushed a commit to zeusdeux/node that referenced this issue Aug 14, 2017
This patch adds support for CIDR notation to the output of the
`networkInterfaces()` method

PR-URL: nodejs#14307
Fixes: nodejs#14006
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
MylesBorins pushed a commit that referenced this issue Sep 9, 2017
This patch adds support for CIDR notation to the output of the
`networkInterfaces()` method

PR-URL: #14307
Fixes: #14006
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. os Issues and PRs related to the os subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants