Skip to content

os.networkInterfaces() does not expose interface's broadcast address #23437

Closed
@pprindeville

Description

@pprindeville
  • Version: v11.0.0-pre
  • Platform: Linux (Ubuntu 16.04.4-LTS)
  • Subsystem: os

The overwhelming majority of network interfaces are Ethernet or Wifi (on servers, almost always Ethernet) which both support broadcasting. The broadcast address is typically the host address bit-wise ANDed with the net mask, and then bit-wise ORed with the bit-wise complement of the net mask.

But not always. Some arcane network configurations still use zero as the host id to signify the broadcast address (i.e. just the host address bit-wise ANDed with the net mask).

That is, for an address such as 192.168.1.12/24 (i.e. net mask of 255.255.255.0), the broadcast address would typically be 192.168.1.255.

That said, the correct behavior is always to take the broadcast address directly from the interface's configuration state, rather than guessing at it.

A mechanism to do exactly that is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.libuvIssues and PRs related to the libuv dependency or the uv binding.stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions