-
Notifications
You must be signed in to change notification settings - Fork 30k
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
dgram: add source-specific multicast support #15735
Conversation
Good to see this and thank you for the PR! First scan through looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking mostly good. Left some comments.
Thanks for the comments. I'll address them soon. One observation is that this is pretty much a copy/paste job based on the existing functions. I.e. the existing code probably also suffers from the issues raised. Would you like me to reflect back changes to the existing functions? |
I'm a bit uncomfortable in landing this without tests, I know very well that testing multicast is complicated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the feedback. Are there any resources for designing tests like this in node? How much of libuv tests (or methodology and test infrastructure) could be reused. This area is all a bit new to me but I completely understand the importance of testing before landing. (edited to fix spelling mistakes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment, but otherwise LGTM. Getting through the rest of the libuv PR is one of my plans for the week.
Are there any resources designing tests like this in node?
I'd look in the test
subdirectories. The files that start with test-dgram-
are a good place to look. You can also take a look at https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md.
How much of libuv tests (or methodology and test infrastructure) could be reused.
The test machines are the same, and you'll likely be able to take the same approach to both. However, the libuv tests are all C and Node's are JS, so you'll have to port them between languages.
Thanks Colin, I hope to follow this up later in the week. |
@cjihrig I've addressed your final review comment about type checking. @mcollina I've added two tests for source-specific multicast (IPv4 and IPv6). These are near identical to the existing test |
@LPardue I went through the libuv PR. It needs updates from the author. I'd like another libuv collaborator to review it as well. |
Indeed, the PR doesn't work on Windows without fixes I suggested there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me!
I think I've addressed review comments. The conflicting file relates to libuv and probably shouldn't be in the PR, I'll try to fix this soon. This is really stalled on libuv/libuv#964 which is awaiting changes in response to review. |
This adds RFC 4607 support for IPv4 and IPv6.
@LPardue I’ve pushed a fix for my comment, included the commit you referenced, and a small fixup to make documentation linting pass (due to relatively new changes to the doc markdown format). I think after that this only requires us to get CI to pass. |
@addaleax thank you! You deserve a 🥇 |
I noticed two deprecation warnings, caused by |
`this._healthCheck()`& `this._handle` caused deprecation warnings.
@n-thumann Done! (with linting issues fixed) |
Landed in 1784b7f 🎉 Thanks for the PR, and sorry for all the delays! ✨ |
This adds RFC 4607 support for IPv4 and IPv6. Co-Authored-By: Nicolas Thumann <[email protected]> Co-Authored-By: Rich Trott <[email protected]> PR-URL: #15735 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This adds RFC 4607 support for IPv4 and IPv6. Co-Authored-By: Nicolas Thumann <[email protected]> Co-Authored-By: Rich Trott <[email protected]> PR-URL: #15735 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This adds RFC 4607 support for IPv4 and IPv6. Co-Authored-By: Nicolas Thumann <[email protected]> Co-Authored-By: Rich Trott <[email protected]> PR-URL: #15735 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Notable changes: * cli: * Added a new flag (`--trace-uncaught`) that makes Node.js print the stack trace at the time of throwing uncaught exceptions, rather than at the creation of the `Error` object, if there is any. This is disabled by default because it affects GC behavior. #30025 * crypto * Added `Hash.prototype.copy()` method. It returns a new `Hash` object with its internal state cloned from the original one. #29910 * dgram * Added source-specific multicast support. This adds methods to Datagram sockets to support RFC 4607 (https://tools.ietf.org/html/rfc4607) for IPv4 and IPv6. #15735 * fs * Added a `bufferSize` option to `fs.opendir()`. It allows to control the number of entries that are buffered internally when reading from the directory. #30114 * meta * Added Chengzhong Wu (https://github.com/legendecas) to collaborators. #30115 PR-URL: #30262
Notable changes: * cli: * Added a new flag (`--trace-uncaught`) that makes Node.js print the stack trace at the time of throwing uncaught exceptions, rather than at the creation of the `Error` object, if there is any. This is disabled by default because it affects GC behavior. #30025 * crypto * Added `Hash.prototype.copy()` method. It returns a new `Hash` object with its internal state cloned from the original one. #29910 * dgram * Added source-specific multicast support. This adds methods to Datagram sockets to support RFC 4607 (https://tools.ietf.org/html/rfc4607) for IPv4 and IPv6. #15735 * fs * Added a `bufferSize` option to `fs.opendir()`. It allows to control the number of entries that are buffered internally when reading from the directory. #30114 * meta * Added Chengzhong Wu (https://github.com/legendecas) to collaborators. #30115 PR-URL: #30262
This adds RFC 4607 support for IPv4 and IPv6. Co-Authored-By: Nicolas Thumann <[email protected]> Co-Authored-By: Rich Trott <[email protected]> PR-URL: #15735 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This adds RFC 4607 support for IPv4 and IPv6. Co-Authored-By: Nicolas Thumann <[email protected]> Co-Authored-By: Rich Trott <[email protected]> PR-URL: #15735 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This adds RFC 4607 support for IPv4 and IPv6. Co-Authored-By: Nicolas Thumann <[email protected]> Co-Authored-By: Rich Trott <[email protected]> PR-URL: #15735 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This adds RFC 4607 support for IPv4 and IPv6. I'm opening this PR to start a discussion, it is not fully realised yet.
This changeset depends on libuv PR 964 and preempts that change being merged into node deps (i.e. it won't compile against master at the time of writing).
In approaching this change I considered modify the existing
addMembership/dropMembership
functions with a new sourceAddress parameter vs. addingaddSourceSpecificMembership/dropSourceSpecificMembership
. Both have merits but I picked the latter, I'm not stuck on it though. It comes does to opinion on which looks worse:socket.addMembership(232.1.1.1, null, 123.45.67.89)
orsocket.addSourceSpecificMembership(123.45.67.89, 232.1.1.1)
.I've tested this manually on a local network but don't currently have any tests defined. I'm not sure what node is looking for in that respect, testing source-specific multicast is hairy.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
dgram