mirror of
https://github.com/moparisthebest/socat
synced 2024-12-21 22:48:48 -05:00
Cygwin port: struct in_pktinfo conditional
This commit is contained in:
parent
91af19a6b7
commit
a6699a96b5
@ -352,6 +352,9 @@
|
||||
/* define if you have struct cmsghdr */
|
||||
#undef HAVE_STRUCT_CMSGHDR
|
||||
|
||||
/* define if you have struct in_pktinfo */
|
||||
#undef HAVE_STRUCT_IN_PKTINFO
|
||||
|
||||
/* define if your struct ip has ip_hl; otherwise assume ip_vhl */
|
||||
#undef HAVE_STRUCT_IP_IP_HL
|
||||
|
||||
|
13
configure.in
13
configure.in
@ -1113,6 +1113,19 @@ if test $sc_cv_struct_cmsghdr = yes; then
|
||||
fi
|
||||
AC_MSG_RESULT($sc_cv_struct_cmsghdr)
|
||||
|
||||
dnl check for struct in_pktinfo
|
||||
AC_MSG_CHECKING(for struct in_pktinfo)
|
||||
AC_CACHE_VAL(sc_cv_struct_in_pktinfo,
|
||||
[AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>],[struct in_pktinfo s;],
|
||||
[sc_cv_struct_in_pktinfo=yes],
|
||||
[sc_cv_struct_in_pktinfo=no])])
|
||||
if test $sc_cv_struct_in_pktinfo = yes; then
|
||||
AC_DEFINE(HAVE_STRUCT_IN_PKTINFO)
|
||||
fi
|
||||
AC_MSG_RESULT($sc_cv_struct_in_pktinfo)
|
||||
|
||||
dnl check for ip_hl in struct ip
|
||||
AC_MSG_CHECKING(for struct ip.ip_hl)
|
||||
AC_CACHE_VAL(sc_cv_struct_ip_ip_hl,
|
||||
|
4
xio-ip.c
4
xio-ip.c
@ -467,7 +467,7 @@ int xiolog_ancillary_ip(struct cmsghdr *cmsg, int *num,
|
||||
xiodump(CMSG_DATA(cmsg), msglen, valbuff, vallen, 0);
|
||||
return STAT_OK;
|
||||
#if WITH_IP4
|
||||
#ifdef IP_PKTINFO
|
||||
#if defined(IP_PKTINFO) && HAVE_STRUCT_IN_PKTINFO
|
||||
case IP_PKTINFO: {
|
||||
struct in_pktinfo *pktinfo = (struct in_pktinfo *)CMSG_DATA(cmsg);
|
||||
*num = 3;
|
||||
@ -481,7 +481,7 @@ int xiolog_ancillary_ip(struct cmsghdr *cmsg, int *num,
|
||||
inet4addr_info(ntohl(pktinfo->ipi_addr.s_addr), scratch3, sizeof(scratch3)));
|
||||
}
|
||||
return STAT_OK;
|
||||
#endif /* IP_PKTINFO */
|
||||
#endif /* defined(IP_PKTINFO) && HAVE_STRUCT_IN_PKTINFO */
|
||||
#endif /* WITH_IP4 */
|
||||
#ifdef IP_RECVERR
|
||||
case IP_RECVERR: {
|
||||
|
Loading…
Reference in New Issue
Block a user