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

src: fill sockaddr_in6.sin6_len when it's defined #2189

Closed
wants to merge 1 commit into from

Conversation

santigimeno
Copy link
Member

@santigimeno santigimeno commented Feb 14, 2019

As some calls in some platforms require.

Example

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

As some calls in some platforms require.
@saghul
Copy link
Member

saghul commented Feb 14, 2019

Is this a problem IRL? In the example the check would succeed because sin6_family is set properly, wouldn't it?

@santigimeno
Copy link
Member Author

santigimeno commented Feb 14, 2019

It returns EINVAL if any of sin6_family or sin6_len are not correctly set.

@santigimeno
Copy link
Member Author

And I've met this issue while trying to bring #964 up to date.

@saghul
Copy link
Member

saghul commented Feb 14, 2019

Doh, sorry, I read that wrong...

@@ -222,6 +222,9 @@ int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) {
memset(addr, 0, sizeof(*addr));
addr->sin6_family = AF_INET6;
addr->sin6_port = htons(port);
#ifdef SIN6_LEN
addr->sin6_len = sizeof(struct sockaddr_in6);
Copy link
Member

Choose a reason for hiding this comment

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

sizeof(*addr) for consistency with other sizeof expressions?

santigimeno added a commit that referenced this pull request Feb 16, 2019
As some calls in some platforms require.

PR-URL: #2189
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@santigimeno
Copy link
Member Author

Landed in 98db184 incorporating Ben's suggestion. Thanks

@santigimeno santigimeno deleted the sin6_len branch February 16, 2019 20:52
njlr pushed a commit to buckaroo-pm/libuv that referenced this pull request Apr 5, 2019
As some calls in some platforms require.

PR-URL: libuv#2189
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
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

4 participants