mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
add configure test for sockaddr_in.sin_len member
git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@237 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
@@ -20,6 +20,15 @@ AC_PROG_RANLIB
|
|||||||
AC_HEADER_STDBOOL
|
AC_HEADER_STDBOOL
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(for sa_len in struct sockaddr)
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>],
|
||||||
|
[struct sockaddr sa; sa.sa_len = 0; return (0);],
|
||||||
|
[AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_SIN_LEN, 1, Define to 1 if sockaddr_in has a sin_len member)],
|
||||||
|
AC_MSG_RESULT(no))
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check availablity of gtest, which might be used for unit tests.
|
# Check availablity of gtest, which might be used for unit tests.
|
||||||
#
|
#
|
||||||
|
@@ -2,4 +2,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_srcdir)/ext
|
|||||||
|
|
||||||
bin_PROGRAMS = parkinglot
|
bin_PROGRAMS = parkinglot
|
||||||
parkinglot_SOURCES = common.cc main.cc
|
parkinglot_SOURCES = common.cc main.cc
|
||||||
parkinglot_LDADD = $(top_srcdir)/src/lib/dns/libdns.a
|
parkinglot_LDADD = $(top_srcdir)/src/lib/dns/libdns.a $(top_srcdir)/src/lib/cc/cpp/libcc.a
|
||||||
|
@@ -36,10 +36,14 @@ Session::establish()
|
|||||||
if (sock < -1)
|
if (sock < -1)
|
||||||
throw SessionError("socket() failed");
|
throw SessionError("socket() failed");
|
||||||
|
|
||||||
sin.sin_len = sizeof(struct sockaddr_in);
|
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
sin.sin_port = htons(9912);
|
sin.sin_port = htons(9912);
|
||||||
sin.sin_addr.s_addr = INADDR_ANY;
|
sin.sin_addr.s_addr = INADDR_ANY;
|
||||||
|
|
||||||
|
#ifdef HAVE_SIN_LEN
|
||||||
|
sin.sin_len = sizeof(struct sockaddr_in);
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = connect(sock, (struct sockaddr *)&sin, sizeof(sin));
|
ret = connect(sock, (struct sockaddr *)&sin, sizeof(sin));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
throw SessionError("connect() failed");
|
throw SessionError("connect() failed");
|
||||||
|
Reference in New Issue
Block a user