You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
os.networkInterfaces() does not expose interface's broadcast address #23437
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.
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?
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.
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.
@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?
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.
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.
Activity
richardlau commentedon Oct 12, 2018
See discussions in libuv/libuv#158 and libuv/libuv#1371 about extending libuv's support for network interfaces.
pprindeville commentedon Oct 13, 2018
Please also see Host Requirements: Broadcasts.
silverwind commentedon Oct 16, 2018
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?
pprindeville commentedon Oct 17, 2018
@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 aconst? I'm a C programmer supporting a JS team...addaleax commentedon Oct 17, 2018
@pprindeville Using
NODE_DEFINE_CONSTANT(target, IN6ADDR_ALLHOSTS_GROUP);in theInitializefunction ofnode_os.ccshould work?7 remaining items
github-actions commentedon Sep 5, 2022
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.
github-actions commentedon Oct 6, 2022
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.
pprindeville commentedon Sep 24, 2024
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?bnoordhuis commentedon Sep 24, 2024
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.
pprindeville commentedon Sep 24, 2024
Yes, it breaks the API because adding an extra field to the structure (a
unionin this case) increases the size of the structure.pprindeville commentedon Sep 24, 2024
See: #23438
os: expose broadcast address in os.networkInterfaces()