-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
os.networkInterfaces() does not expose interface's broadcast address #23437
Comments
See discussions in libuv/libuv#158 and libuv/libuv#1371 about extending libuv's support for network interfaces. |
Please also see Host Requirements: Broadcasts. |
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? |
@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 ( |
@pprindeville Using |
Even though the argument is of type
|
Not using the correct broadcast address in applications can cause disasterous results. Rather than letting the programmer guess at the broadcast address and try to derive it correctly, allow him to query the system instead for the correctly configured state. Fixes: nodejs#23437 Depends-on: libuv/libuv#2033
@addaleax Okay, got that resolved so it’s exporting in JS properly. |
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. |
There's been progress in libuv, but I'm trying to add test coverage... |
@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. |
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. |
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. |
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 of255.255.255.0
), the broadcast address would typically be192.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.
The text was updated successfully, but these errors were encountered: