Commit ae0982d3 authored by Evan Hunt's avatar Evan Hunt
Browse files

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
parent d733113e
......@@ -20,6 +20,15 @@ AC_PROG_RANLIB
AC_HEADER_STDBOOL
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.
#
......
......@@ -2,4 +2,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_srcdir)/ext
bin_PROGRAMS = parkinglot
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)
throw SessionError("socket() failed");
sin.sin_len = sizeof(struct sockaddr_in);
sin.sin_family = AF_INET;
sin.sin_port = htons(9912);
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));
if (ret < 0)
throw SessionError("connect() failed");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment