X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fcm_inet.c;h=cd12a0a7295389e4607c0c4913f2b056546625df;hb=6c530e3037c009f3c4ec76a14128e89c7a9db0a3;hp=1785db483f5577e533ad00a5bfa1237bee6e837c;hpb=829bbd114f1c3dc00c1da47bca0a8207c049df3f;p=o-du%2Fl2.git diff --git a/src/cm/cm_inet.c b/src/cm/cm_inet.c index 1785db483..cd12a0a72 100644 --- a/src/cm/cm_inet.c +++ b/src/cm/cm_inet.c @@ -152,6 +152,7 @@ extern "C" { #ifdef NTL_LIB #include "ntl_lib.h" #endif +#include "du_log.h" /* local defines */ @@ -1857,6 +1858,8 @@ U16 port; /* port number */ #else /* linux */ ret = sctp_bindx(sockFd->fd, (struct sockaddr*)address_array, addrLst->count, SCTP_BINDX_ADD_ADDR); + UNUSED(sockAddrPtr); + UNUSED(sockAddrLen); #endif if (ret == INET_ERR) { @@ -1915,6 +1918,10 @@ U16 port; /* port number */ /* cm_inet_c_001.main_46: Removed SS_LINUX flag */ S32 idx; +/* cm_inet_c_001.main_64: New variable used as an argument for sctp_connectx */ +#ifdef SCTP_CONNECTX_NEW + U32 assocId = 0; +#endif U32 addresses_array_size = 0; U32 idx4 = 0; struct sockaddr_in addrs[CM_INET_NUM_NET_ADDR]; @@ -2189,6 +2196,7 @@ U16 port; /* port number */ { RETVALUE(RFAILED); } + #ifdef IPV6_SUPPORTED if((ipv6_array_size > 0) && (ipv6_array_size <= (CM_INET_NUM_NET_ADDR * \ sizeof(struct sockaddr_in)))) @@ -2201,7 +2209,12 @@ U16 port; /* port number */ } #endif /* IPV6_SUPPORTED */ +/* cm_inet_c_001.main_64: Support for new definition of sctp_connectx */ +#ifndef SCTP_CONNECTX_NEW ret = sctp_connectx(sockFd->fd, (struct sockaddr*)address_array, cnt); +#else + ret = sctp_connectx(sockFd->fd, (struct sockaddr*)address_array, cnt, (sctp_assoc_t *)&assocId); +#endif #else /* solaris */ @@ -2284,10 +2297,8 @@ U16 port; /* port number */ " sockFd->fd(%ld)\n", INET_ERR_CODE, port, sockFd->fd); CMINETLOGERROR(ERRCLS_DEBUG, ECMINET010, 0, prntBuf); #else - /* cm_inet_c_001.main_62:Warning fix */ - snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "CmInetSctpConnectx() Failed : error(%d), port(0x%1x)," - " sockFd->fd(%d)\n", INET_ERR_CODE, port, sockFd->fd); - CMINETLOGERROR(ERRCLS_DEBUG, ECMINET010, 0, prntBuf); + DU_LOG("\nCmInetSctpConnectx() Failed : error(%d), port(0x%1x),\ + sockFd->fd(%d)\n", INET_ERR_CODE, port, sockFd->fd); #endif /*ALIGN_64BIT*/ #endif /* CMINETDBG */ @@ -2766,10 +2777,8 @@ CmInetSctpNotification *ntfy; /* notification parameters */ " sockFd->fd(%ld)\n", INET_ERR_CODE, sockFd->fd); CMINETLOGERROR(ERRCLS_DEBUG, ECMINET014, 0, prntBuf); #else - /* cm_inet_c_001.main_62:Warning fix */ - snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "cmInetSctpRecvMsg() Failed : error(%d)," - " sockFd->fd(%d)\n", INET_ERR_CODE, sockFd->fd); - CMINETLOGERROR(ERRCLS_DEBUG, ECMINET014, 0, prntBuf); + DU_LOG("\ncmInetSctpRecvMsg() Failed : error(%d), sockFd->fd(%d)", \ + INET_ERR_CODE, sockFd->fd); #endif /*ALIGN_64BIT*/ #endif /* CMINETDBG */ @@ -3356,12 +3365,14 @@ Ptr value; /* option value */ if (status.sstat_primary.spinfo_state == SCTP_ACTIVE) pSctpStatus->primary.isActive = TRUE; else + { pSctpStatus->primary.isActive = FALSE; pSctpStatus->primary.cwnd = status.sstat_primary.spinfo_cwnd; pSctpStatus->primary.srtt = status.sstat_primary.spinfo_srtt; pSctpStatus->primary.rto = status.sstat_primary.spinfo_rto; pSctpStatus->primary.mtu = status.sstat_primary.spinfo_mtu; - break; + } + break; case CM_INET_OPT_SCTP_GET_PADDR_INFO: pPeerAddrInfo = (CmInetSctpPeerAddrInfo*)value;