diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c index 06e606e36b616ecb61be147e548f4e3580dc6c65..df6dde0f9977f0882a833ecaa3aa504d8ab00472 100644 --- a/openair3/SCTP/sctp_eNB_task.c +++ b/openair3/SCTP/sctp_eNB_task.c @@ -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) {