Skip to content

CIDR support for os.networkInterfaces #14006

@silverwind

Description

@silverwind

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'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.osIssues and PRs related to the os subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions