Use correct structure in sctp_eNB_accept_associations()

This commit is contained in:
Robert Schmidt
2022-07-20 10:40:32 +02:00
parent 6b757c5320
commit db7f39ba19
+3 -3
View File
@@ -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) {