Skip to content
Snippets Groups Projects
Commit db7f39ba authored by Robert Schmidt's avatar Robert Schmidt
Browse files

Use correct structure in sctp_eNB_accept_associations()

parent 6b757c53
No related branches found
No related tags found
3 merge requests!1757Draft: Use pMAX value in configuration file, instead of hardcoded '23' in asn1_msg.c,!1626integration_2022_wk30,!1568Add undefined behavior sanitizer in `build_oai`, fix some errors
......@@ -859,7 +859,7 @@ sctp_eNB_accept_associations(
struct sctp_cnx_list_elm_s *sctp_cnx)
{
int client_sd;
struct sockaddr saddr;
struct sockaddr_in6 saddr;
socklen_t saddr_size;
DevAssert(sctp_cnx != NULL);
......@@ -868,14 +868,14 @@ sctp_eNB_accept_associations(
/* There is a new client connecting. Accept it...
*/
if ((client_sd = accept(sctp_cnx->sd, &saddr, &saddr_size)) < 0) {
if ((client_sd = accept(sctp_cnx->sd, (struct sockaddr*)&saddr, &saddr_size)) < 0) {
SCTP_ERROR("[%d] accept failed: %s:%d\n", sctp_cnx->sd, strerror(errno), errno);
} else {
struct sctp_cnx_list_elm_s *new_cnx;
uint16_t port;
/* This is an ipv6 socket */
port = ((struct sockaddr_in6*)&saddr)->sin6_port;
port = saddr.sin6_port;
/* Contrary to BSD, client socket does not inherit O_NONBLOCK option */
if (fcntl(client_sd, F_SETFL, O_NONBLOCK) < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment