port to Cygwin - struct pktinfo.ipi_spec_dst

This commit is contained in:
Gerhard Rieger 2012-07-22 20:49:21 +02:00
parent 93e12161a3
commit f536cb6616
5 changed files with 33 additions and 2 deletions

View file

@ -104,6 +104,10 @@ porting:
Cedril Priscal ported socat to Android (using Googles cross compiler).
The port includes the socat_buildscript_for_android.sh script
added check for component ipi_spec_dst in struct in_pktinfo so
compilation does not fail on Cygwin (thanks to Peter Wagemans for
reporting this problem)
####################### V 2.0.0-b7:

View file

@ -363,6 +363,9 @@
/* define if you have struct in_pktinfo */
#undef HAVE_STRUCT_IN_PKTINFO
/* define if your struct in_pktinfo has component ipi_spec_dst */
#undef HAVE_PKTINFO_IPI_SPEC_DST
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */
#undef HAVE_STRUCT_IP_IP_HL

View file

@ -1176,6 +1176,21 @@ if test $sc_cv_struct_in_pktinfo = yes; then
AC_DEFINE(HAVE_STRUCT_IN_PKTINFO)
fi
AC_MSG_RESULT($sc_cv_struct_in_pktinfo)
if test $sc_cv_struct_in_pktinfo = 'yes'; then
dnl check for component ipi_spec_dst in struct in_pktinfo
AC_MSG_CHECKING(for ipi_spec_dst in struct in_pktinfo)
AC_CACHE_VAL(sc_cv_pktinfo_ipi_spec_dst,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],[struct in_pktinfo s; s.ipi_spec_dst],
[sc_cv_pktinfo_ipi_spec_dst=yes],
[sc_cv_pktinfo_ipi_spec_dst=no])])
if test $sc_cv_pktinfo_ipi_spec_dst = yes; then
AC_DEFINE(HAVE_PKTINFO_IPI_SPEC_DST)
fi
AC_MSG_RESULT($sc_cv_pktinfo_ipi_spec_dst)
fi
dnl check for ip_hl in struct ip
AC_MSG_CHECKING(for struct ip.ip_hl)

View file

@ -477,8 +477,15 @@ int xiolog_ancillary_ip(struct cmsghdr *cmsg, int *num,
"IP_LOCADDR", '\0', "IP_DSTADDR");
snprintf(valbuff, vallen, "%s%c%s%c%s",
xiogetifname(pktinfo->ipi_ifindex, scratch1, -1), '\0',
inet4addr_info(ntohl(pktinfo->ipi_spec_dst.s_addr), scratch2, sizeof(scratch2)), '\0',
inet4addr_info(ntohl(pktinfo->ipi_addr.s_addr), scratch3, sizeof(scratch3)));
#if HAVE_PKTINFO_IPI_SPEC_DST
inet4addr_info(ntohl(pktinfo->ipi_spec_dst.s_addr),
scratch2, sizeof(scratch2)),
#else
"",
#endif
'\0',
inet4addr_info(ntohl(pktinfo->ipi_addr.s_addr),
scratch3, sizeof(scratch3)));
}
return STAT_OK;
#endif /* defined(IP_PKTINFO) && HAVE_STRUCT_IN_PKTINFO */

View file

@ -712,7 +712,9 @@ enum e_optcode {
# undef ENABLE_OPTCODE
OPT_SUBSTUSER_EARLY,
OPT_SUBSTUSER,
#if defined(HAVE_SETGRENT) && defined(HAVE_GETGRENT) && defined(HAVE_ENDGRENT)
OPT_SUBSTUSER_DELAYED,
#endif
OPT_SYMBOLIC_LINK, /* with pty */
#ifdef TABDLY
# ifdef TAB0