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:
parent
ecd075d0ac
commit
580f5c0c9e
10
configure.in
10
configure.in
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue