You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "wangchen61698 (via GitHub)" <gi...@apache.org> on 2023/08/03 03:46:25 UTC
[GitHub] [nuttx] wangchen61698 opened a new pull request, #10028: net:Add check for address binding
wangchen61698 opened a new pull request, #10028:
URL: https://github.com/apache/nuttx/pull/10028
## Summary
Add check for address binding
libuvtestcase1:
TEST_IMPL(tcp_bind_error_addrnotavail_2) {
struct sockaddr_in addr;
uv_tcp_t server;
int r;
init_called_count();
ASSERT(0 == uv_ip4_addr("[4.4.4.4](http://4.4.4.4/)", TEST_PORT, &addr));
r = uv_tcp_init(uv_default_loop(), &server);
ASSERT(r == 0);
r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0);
ASSERT(r == UV_EADDRNOTAVAIL);
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
MAKE_VALGRIND_HAPPY();
return 0;
}
libuvtestcase2:
TEST_IMPL(tcp_bind6_error_addrnotavail) {
struct sockaddr_in6 addr;
uv_tcp_t server;
int r;
close_cb_called = 0;
if (!can_ipv6())
RETURN_SKIP("IPv6 not supported");
ASSERT(0 == uv_ip6_addr("4:4:4:4:4:4:4:4", TEST_PORT, &addr));
r = uv_tcp_init(uv_default_loop(), &server);
ASSERT(r == 0);
r = uv_tcp_bind(&server, (const struct sockaddr*) &addr, 0);
ASSERT(r == UV_EADDRNOTAVAIL);
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
MAKE_VALGRIND_HAPPY();
return 0;
}
## Impact
## Testing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] wangchen61698 closed pull request #10028: net:Add check for address binding
Posted by "wangchen61698 (via GitHub)" <gi...@apache.org>.
wangchen61698 closed pull request #10028: net:Add check for address binding
URL: https://github.com/apache/nuttx/pull/10028
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org