Detect if sctp_connectx() has 3 or 4 arguments.

git-svn-id: http://voip.null.ro/svn/yate@3059 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-02-02 16:46:53 +00:00
parent ecd075d0ac
commit 580f5c0c9e
2 changed files with 14 additions and 0 deletions

View File

@ -287,6 +287,16 @@ if [[ "x$HAVE_SCTP_NETINET" != "xno" ]]; then
# including netinet/sctp.h fixes SCTP support so enable it
HAVE_SCTP=yes
SCTP_FLAGS="-DHAVE_SCTP -DHAVE_SCTP_NETINET"
sctp_connectx_new=no
AC_MSG_CHECKING([whether sctp_connectx has 4 arguments])
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>],[sctp_connectx(0,0,0,0);],[sctp_connectx_new=yes])
AC_MSG_RESULT([$sctp_connectx_new])
if [[ "x$sctp_connectx_new" = "xyes" ]]; then
SCTP_FLAGS="$SCTP_FLAGS -DHAVE_SCTP_CONNECTX_4"
fi
else
if [[ "x$HAVE_SCTP" != "xno" ]]; then
SCTP_FLAGS="-DHAVE_SCTP"

View File

@ -114,7 +114,11 @@ bool LKSocket::connectx(ObjList& addresses)
SocketAddr* a = static_cast<SocketAddr*>(o->get());
addr[i++] = *(a->address());
}
#ifdef HAVE_SCTP_CONNECTX_4
int error = sctp_connectx(handle(),addr,addresses.count(),NULL);
#else
int error = sctp_connectx(handle(),addr,addresses.count());
#endif
return (error >= 0);
}