Skip to content
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

udp: add source-specific multicast support #2202

Merged
merged 7 commits into from Aug 23, 2019
Merged

Conversation

santigimeno
Copy link
Member

This is a continuation of #964 with some fixes and tests.
For the tests, I've been working on top of #2185, so you can skip that commit for the review.
CI is fine except for the failures already reported in #2185 (comment).

CI: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/1245/

src/unix/udp.c Outdated
const char* source_addr,
uv_membership membership) {
int err;
union sockaddr {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use struct sockadr_storage here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I thought about it when going through the changes but went for this approach for a couple of reasons:

  • I didn't want to change the original PR much.
  • The current multicast method already uses strings instead of sockaddr_ structs (which I guess that's the reason why this interface was chosen).

That said, I think it makes more sense using sockaddr_ structs in both methods, but I guess that'll have to go into master?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saghul disregard my last comment. I though you were talking about the function arguments 🤦‍♂️

About using struct sockaddr_storage I already commented about it in the original PR, but thought this option looked cleaner.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Not my cup of tea, but I won't block this based on that.

Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as long as the CI is 💚

@BridgeAR
Copy link

BridgeAR commented Mar 9, 2019

Would someone be so kind and kick off the CI and land this if everything is fine? @santigimeno @saghul @cjihrig @bnoordhuis

It would be great to get this in libuv so we can progress on a long outstanding Node.js PR.

@santigimeno
Copy link
Member Author

CI: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/1253/

As expected, we're getting the same failures as in #2185. Let's see if we can resolve those before merging this.

@santigimeno
Copy link
Member Author

@saghul I've updated the PR to use sockaddr_storage.

CI: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/1257/

Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still LGTM, if tests are 💚

@Trott
Copy link
Contributor

Trott commented Jul 6, 2019

Polite bump/ping. nodejs/node#15735 is currently blocked on this.

@santigimeno
Copy link
Member Author

I would love landing this, but it's blocked by #2185 which, unfortunately, I don't think we're close to.

@santigimeno
Copy link
Member Author

Rebased to current v1.x and now that #2185 has landed let's see what the CI says: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/1545/

Vladimir Karnushin and others added 7 commits August 23, 2019 21:09
PR-URL: libuv#2202
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
PR-URL: libuv#2202
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
All the supported platforms support specific source multicast.

PR-URL: libuv#2202
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Use the correct socket options: `MCAST_JOIN_SOURCE_GROUP` and
`MCAST_LEAVE_SOURCE_GROUP`.
Set mreq.gsr_interface = 0 if iface_addr = NULL.

PR-URL: libuv#2202
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
PR-URL: libuv#2202
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
To support source specific multicast operations.

PR-URL: libuv#2202
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
PR-URL: libuv#2202
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
@santigimeno
Copy link
Member Author

@santigimeno
Copy link
Member Author

CI is green except for the known flaky tests. Landing.

@santigimeno santigimeno merged commit 24e65f7 into libuv:v1.x Aug 23, 2019
@santigimeno santigimeno deleted the ssm_2 branch August 23, 2019 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants