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

@ -105,6 +105,10 @@ porting:
Cedril Priscal ported socat to Android (using Googles cross compiler). Cedril Priscal ported socat to Android (using Googles cross compiler).
The port includes the socat_buildscript_for_android.sh script 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: ####################### V 2.0.0-b7:
security: security:

View file

@ -364,6 +364,9 @@
/* define if you have struct in_pktinfo */ /* define if you have struct in_pktinfo */
#undef 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 */ /* define if your struct ip has ip_hl; otherwise assume ip_vhl */
#undef HAVE_STRUCT_IP_IP_HL #undef HAVE_STRUCT_IP_IP_HL

View file

@ -1177,6 +1177,21 @@ if test $sc_cv_struct_in_pktinfo = yes; then
fi fi
AC_MSG_RESULT($sc_cv_struct_in_pktinfo) 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 dnl check for ip_hl in struct ip
AC_MSG_CHECKING(for struct ip.ip_hl) AC_MSG_CHECKING(for struct ip.ip_hl)
AC_CACHE_VAL(sc_cv_struct_ip_ip_hl, AC_CACHE_VAL(sc_cv_struct_ip_ip_hl,

View file

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

View file

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