Skip to content

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

Closed

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.

Activity

  1. added
    libuvIssues and PRs related to the libuv dependency or the uv binding.
    on Oct 12, 2018
  2. richardlau commented on Oct 12, 2018

    @richardlau
    Member

    See discussions in libuv/libuv#158 and libuv/libuv#1371 about extending libuv's support for network interfaces.

  3. pprindeville commented on Oct 13, 2018

    @pprindeville
    Author
  4. silverwind commented on Oct 16, 2018

    @silverwind
    Contributor

    This is a IPv4-only feature right? To my knowledge, there is no such concept as a broadcast on IPv6. Do the underlying OS APIs still expose a broadcast address on IPv6?

  5. pprindeville commented on Oct 17, 2018

    @pprindeville
    Author

    @silverwind That's correct. Is there a preferred way to export constants in JS? See:

    https://github.com/libuv/libuv/pull/2033/files#diff-56343bd7ad8bf449c2693082fb3e4081R1097

    how do I export this (IN6ADDR_ALLHOSTS_GROUP) into the JS space from C as a const? I'm a C programmer supporting a JS team...

  6. addaleax commented on Oct 17, 2018

    @addaleax
    Member

    @pprindeville Using NODE_DEFINE_CONSTANT(target, IN6ADDR_ALLHOSTS_GROUP); in the Initialize function of node_os.cc should work?

  7. 7 remaining items

  8. moved this from Pending Triage to Stale in Node.js feature requestson Mar 6, 2022
  9. moved this to Pending Triage in Node.js feature requestson Mar 6, 2022
  10. removed
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Mar 8, 2022
  11. github-actions commented on Sep 5, 2022

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  12. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Sep 5, 2022
  13. github-actions commented on Oct 6, 2022

    @github-actions
    Contributor

    There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  14. pprindeville commented on Sep 24, 2024

    @pprindeville
    Author

    @pprindeville if you're referring to libuv/libuv#1371, that never got merged. You're of course welcome to dust it off and re-submit it for review. I think it was close.

    libuv/libuv#2033 did get merged, however the version of deps/uv/ is not up to date. What's the rationale for putting it in-tree?

  15. bnoordhuis commented on Sep 24, 2024

    @bnoordhuis
    Member

    libuv/libuv#2033 was merged to master (what someday may become libuv 2.0), presumably because it changed API or ABI in a backward incompatible way? The copy of libuv in node is v1.x.

  16. pprindeville commented on Sep 24, 2024

    @pprindeville
    Author

    libuv/libuv#2033 was merged to master (what someday may become libuv 2.0), presumably because it changed API or ABI in a backward incompatible way? The copy of libuv in node is v1.x.

    Yes, it breaks the API because adding an extra field to the structure (a union in this case) increases the size of the structure.

  17. pprindeville commented on Sep 24, 2024

    @pprindeville
    Author

    See: #23438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.libuvIssues and PRs related to the libuv dependency or the uv binding.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions