diff --git a/CHANGES b/CHANGES index 2d5eb5a..195eb6a 100644 --- a/CHANGES +++ b/CHANGES @@ -39,6 +39,10 @@ Porting: Thanks to Martin Dorey for reporting and analyzing this issue, and for providing an environment for reproduction. + Socat failed to compile on platforms that have + IP_ADD_SOURCE_MEMBERSHIP but not struct ip_mreq_source + Thanks to Justin Yackoski for sending a patch. + Testing: Unset SOCAT_MAIN_WAIT on informational Socat calls diff --git a/xio-ip.c b/xio-ip.c index dd288ad..11f0797 100644 --- a/xio-ip.c +++ b/xio-ip.c @@ -71,7 +71,7 @@ const struct optdesc opt_ip_pktoptions = { "ip-pktoptions", "pktopts", OPT_IP_PK #ifdef IP_ADD_MEMBERSHIP const struct optdesc opt_ip_add_membership = { "ip-add-membership", "membership",OPT_IP_ADD_MEMBERSHIP, GROUP_SOCK_IP, PH_PASTSOCKET, TYPE_IP_MREQN, OFUNC_SOCKOPT, SOL_IP, IP_ADD_MEMBERSHIP }; #endif -#ifdef IP_ADD_SOURCE_MEMBERSHIP +#if defined(HAVE_STRUCT_IP_MREQ_SOURCE) && defined(IP_ADD_SOURCE_MEMBERSHIP) const struct optdesc opt_ip_add_source_membership = { "ip-add-source-membership", "source-membership",OPT_IP_ADD_SOURCE_MEMBERSHIP, GROUP_SOCK_IP, PH_PASTSOCKET, TYPE_IP_MREQ_SOURCE, OFUNC_SOCKOPT, SOL_IP, IP_ADD_SOURCE_MEMBERSHIP }; #endif #ifdef IP_RECVDSTADDR diff --git a/xioopts.c b/xioopts.c index 5634cb5..ecd30d4 100644 --- a/xioopts.c +++ b/xioopts.c @@ -164,7 +164,7 @@ const struct optname optionnames[] = { #ifdef IP_ADD_MEMBERSHIP IF_IP ("add-membership", &opt_ip_add_membership) #endif -#ifdef IP_ADD_SOURCE_MEMBERSHIP +#if defined(HAVE_STRUCT_IP_MREQ_SOURCE) && defined(IP_ADD_SOURCE_MEMBERSHIP) IF_IP ("add-source-membership", &opt_ip_add_source_membership) #endif IF_TUN ("allmulti", &opt_iff_allmulti) @@ -678,7 +678,7 @@ const struct optname optionnames[] = { #ifdef IP_ADD_MEMBERSHIP IF_IP ("ip-add-membership", &opt_ip_add_membership) #endif -#ifdef IP_ADD_SOURCE_MEMBERSHIP +#if defined(HAVE_STRUCT_IP_MREQ_SOURCE) && defined(IP_ADD_SOURCE_MEMBERSHIP) IF_IP ("ip-add-source-membership", &opt_ip_add_source_membership) #endif #ifdef IP_FREEBIND @@ -1563,7 +1563,7 @@ const struct optname optionnames[] = { IF_SOCKS4 ("socksport", &opt_socksport) IF_SOCKS4 ("socksuser", &opt_socksuser) IF_SOCKET ("socktype", &opt_so_type) -#ifdef IP_ADD_SOURCE_MEMBERSHIP +#if defined(HAVE_STRUCT_IP_MREQ_SOURCE) && defined(IP_ADD_SOURCE_MEMBERSHIP) IF_IP ("source-membership", &opt_ip_add_source_membership) #endif IF_IPAPP ("sourceport", &opt_sourceport) @@ -2507,7 +2507,7 @@ int parseopts_table(const char **a, unsigned int groups, struct opt **opts, break; #endif /* defined(HAVE_STRUCT_IP_MREQ) || defined (HAVE_STRUCT_IP_MREQN) */ -#if HAVE_STRUCT_IP_MREQ_SOURCE +#if defined(HAVE_STRUCT_IP_MREQ_SOURCE) && defined(IP_ADD_SOURCE_MEMBERSHIP) case TYPE_IP_MREQ_SOURCE: xiotype_ip_add_source_membership(token, ent, opt); break; diff --git a/xiosysincludes.h b/xiosysincludes.h index f509c0a..71eba0f 100644 --- a/xiosysincludes.h +++ b/xiosysincludes.h @@ -9,5 +9,7 @@ #include "xioconfig.h" /* what features are enabled */ #include "sysincludes.h" +//#undef IP_ADD_SOURCE_MEMBERSHIP +#undef HAVE_STRUCT_IP_MREQ_SOURCE #endif /* !defined(__xiosysincludes_h_included) */