1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-13 23:13:24 +00:00

Fixed build issues on disabled features

This commit is contained in:
Gerhard Rieger 2025-01-29 21:49:16 +01:00
parent af7d44d751
commit 7a90caade5
21 changed files with 182 additions and 95 deletions

View file

@ -177,7 +177,7 @@ static int applyopt(struct single *sfd, int fd, struct opt *opt);
binary search! */
/* NULL terminated */
const struct optname optionnames[] = {
#if HAVE_RESOLV_H && WITH_RES_AAONLY
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H && WITH_RES_AAONLY
IF_RESOLVE("aaonly", &opt_res_aaonly)
#endif
#ifdef TCP_ABORT_THRESHOLD /* HP_UX */
@ -421,7 +421,7 @@ const struct optname optionnames[] = {
#ifdef TCP_DEFER_ACCEPT /* Linux 2.4.0 */
IF_TCP ("defer-accept", &opt_tcp_defer_accept)
#endif
#if HAVE_RESOLV_H
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H
IF_RESOLVE("defnames", &opt_res_defnames)
#endif /* HAVE_RESOLV_H */
#ifdef O_DELAY
@ -454,10 +454,10 @@ const struct optname optionnames[] = {
#ifdef VDISCARD
IF_TERMIOS("discard", &opt_vdiscard)
#endif
#if WITH_RESOLVE && HAVE_RESOLV_H && HAVE_RES_NSADDR_LIST
#if (WITH_IP4 || WITH_IP6) && WITH_RESOLVE && HAVE_RESOLV_H && HAVE_RES_NSADDR_LIST
IF_IP ("dns", &opt_res_nsaddr)
#endif
#if HAVE_RESOLV_H
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H
IF_RESOLVE("dnsrch", &opt_res_dnsrch)
#endif /* HAVE_RESOLV_H */
#ifdef SO_DONTLINGER
@ -721,7 +721,7 @@ const struct optname optionnames[] = {
IF_ANY ("ignoreeof", &opt_ignoreeof)
IF_ANY ("ignoreof", &opt_ignoreeof)
IF_TERMIOS("ignpar", &opt_ignpar)
#if HAVE_RESOLV_H
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H
IF_RESOLVE("igntc", &opt_res_igntc)
#endif /* HAVE_RESOLV_H */
IF_TERMIOS("imaxbel", &opt_imaxbel)
@ -1050,7 +1050,7 @@ const struct optname optionnames[] = {
IF_IP ("multicast-ttl", &opt_ip_multicast_ttl)
IF_IP ("multicastloop", &opt_ip_multicast_loop)
IF_IP ("multicastttl", &opt_ip_multicast_ttl)
#if WITH_RESOLVE && HAVE_RESOLV_H && HAVE_RES_NSADDR_LIST
#if (WITH_IP4 || WITH_IP6) && WITH_RESOLVE && HAVE_RESOLV_H && HAVE_RES_NSADDR_LIST
IF_IP ("nameserver", &opt_res_nsaddr)
#endif
#if defined(O_NDELAY) && (!defined(O_NONBLOCK) || O_NDELAY != O_NONBLOCK)
@ -1118,7 +1118,7 @@ const struct optname optionnames[] = {
IF_OPENSSL("nosni", &opt_openssl_no_sni)
#endif
IF_INTERFACE("notrailers", &opt_iff_notrailers)
#if WITH_RESOLVE && HAVE_RESOLV_H && HAVE_RES_NSADDR_LIST
#if (WITH_IP4 || WITH_IP6) && WITH_RESOLVE && HAVE_RESOLV_H && HAVE_RES_NSADDR_LIST
IF_IP ("nsaddr", &opt_res_nsaddr)
#endif
#ifdef O_NSHARE
@ -1350,7 +1350,7 @@ const struct optname optionnames[] = {
#if WITH_POSIXMQ
IF_ANY ("posixmq-priority", &opt_posixmq_priority)
#endif
#if HAVE_RESOLV_H && WITH_RES_PRIMARY
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H && WITH_RES_PRIMARY
IF_RESOLVE("primary", &opt_res_primary)
#endif
#ifdef SO_PRIORITY
@ -1411,7 +1411,7 @@ const struct optname optionnames[] = {
IF_OPEN ("rdonly", &opt_o_rdonly)
IF_OPEN ("rdwr", &opt_o_rdwr)
IF_ANY ("readbytes", &opt_readbytes)
#if HAVE_RESOLV_H
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H
IF_RESOLVE("recurse", &opt_res_recurse)
#endif /* HAVE_RESOLV_H */
#ifdef IP_RECVDSTADDR
@ -1451,7 +1451,7 @@ const struct optname optionnames[] = {
#ifdef VREPRINT
IF_TERMIOS("reprint", &opt_vreprint)
#endif
#if HAVE_RESOLV_H
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H
# if WITH_AA_ONLY
IF_RESOLVE("res-aaonly", &opt_res_aaonly)
# endif
@ -1480,15 +1480,15 @@ const struct optname optionnames[] = {
# endif
IF_RESOLVE("res-stayopen", &opt_res_stayopen)
IF_RESOLVE("res-usevc", &opt_res_usevc)
#endif /* HAVE_RESOLV_H */
#endif /* (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H */
IF_PROXY ("resolv", &opt_proxy_resolve)
IF_PROXY ("resolve", &opt_proxy_resolve)
#ifdef IP_RETOPTS
IF_IP ("retopts", &opt_ip_retopts)
#endif
# if HAVE_RES_RETRANS
#if (WITH_IP4 || WITH_IP6) && HAVE_RES_RETRANS
IF_RESOLVE("retrans", &opt_res_retrans)
# endif
#endif
#if WITH_INTERFACE && defined(PACKET_AUXDATA)
IF_SOCKET ("retrieve-vlan", &opt_retrieve_vlan)
#endif
@ -1724,7 +1724,7 @@ const struct optname optionnames[] = {
IF_IPAPP ("sourceport", &opt_sourceport)
IF_IPAPP ("sp", &opt_sourceport)
IF_TERMIOS("start", &opt_vstart)
#if HAVE_RESOLV_H
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H
IF_RESOLVE("stayopen", &opt_res_stayopen)
#endif /* HAVE_RESOLV_H */
IF_EXEC ("stderr", &opt_stderr)
@ -1930,7 +1930,7 @@ const struct optname optionnames[] = {
IF_ANY ("user", &opt_user)
IF_NAMED ("user-early", &opt_user_early)
IF_ANY ("user-late", &opt_user_late)
#if HAVE_RESOLV_H
#if (WITH_IP4 || WITH_IP6) && HAVE_RESOLV_H
IF_RESOLVE("usevc", &opt_res_usevc)
#endif /* HAVE_RESOLV_H */
#if defined(AI_V4MAPPED)
@ -2654,13 +2654,13 @@ int parseopts_table(const char **a, groups_t groups, struct opt **opts,
(*opts)[i].value3.u_string);
break;
#if defined(HAVE_STRUCT_IP_MREQ) || defined (HAVE_STRUCT_IP_MREQN)
#if (WITH_IP4 || WITH_IP6) && ( defined(HAVE_STRUCT_IP_MREQ) || defined (HAVE_STRUCT_IP_MREQN) )
case TYPE_IP_MREQN:
xiotype_ip_add_membership(token, ent, opt);
break;
#endif /* defined(HAVE_STRUCT_IP_MREQ) || defined (HAVE_STRUCT_IP_MREQN) */
#endif /* WITH_IP && defined(HAVE_STRUCT_IP_MREQ) || defined (HAVE_STRUCT_IP_MREQN) ) */
#if defined(HAVE_STRUCT_IP_MREQ_SOURCE) && defined(IP_ADD_SOURCE_MEMBERSHIP)
#if _WITH_IP4 && defined(HAVE_STRUCT_IP_MREQ_SOURCE)
case TYPE_IP_MREQ_SOURCE:
xiotype_ip_add_source_membership(token, ent, opt);
break;
@ -3323,6 +3323,7 @@ int retropt_bind(struct opt *opts,
}
}
# if WITH_IP4 || WITH_IP6
/* Set AI_PASSIVE, except when it is explicitely disabled */
ai_flags2[0] = ai_flags[0];
ai_flags2[1] = ai_flags[1];
@ -3337,6 +3338,8 @@ int retropt_bind(struct opt *opts,
Error("error resolving bind option");
return STAT_NORETRY;
}
/*# else */
# endif /* WITH_IP4 || WITH_IP6 */
break;
#endif /* WITH_IP4 || WITH_IP6 || WITH_VSOCK */
@ -3567,6 +3570,8 @@ int applyopt_ioctl_generic(
return 0;
}
#if _WITH_SOCKET
int applyopt_sockopt(
int fd,
struct opt *opt)
@ -3695,7 +3700,7 @@ int applyopt_sockopt(
}
break;
#endif /* HAVE_STRUCT_LINGER */
#if defined(HAVE_STRUCT_IP_MREQ) || defined (HAVE_STRUCT_IP_MREQN)
#if (WITH_IP4 || WITH_IP6) && ( defined(HAVE_STRUCT_IP_MREQ) || defined (HAVE_STRUCT_IP_MREQN) )
case TYPE_IP_MREQN:
/* handled in applyopts_single */
break;
@ -3815,6 +3820,8 @@ int applyopt_sockopt_generic(
return 0;
}
#endif /* _WITH_SOCKET */
int applyopt_flock(
int fd,
struct opt *opt)
@ -4272,6 +4279,7 @@ static int applyopt_offset(struct single *sfd, struct opt *opt) {
case TYPE_CONST:
*(int *)ptr = opt->desc->minor;
break;
#if WITH_IP4
case TYPE_IP4NAME:
memset(ptr, 0, sizeof(struct sockaddr_in));
((struct sockaddr_in *)ptr)->sin_addr = opt->value.u_ip4addr;
@ -4281,6 +4289,7 @@ static int applyopt_offset(struct single *sfd, struct opt *opt) {
memset(ptr, 0, sizeof(struct sockaddr_in));
*(struct sockaddr_in *)ptr = opt->value.u_ip4sock;
break;
#endif /* WITH_IP4 */
default:
Error2("applyopt_offset(opt:%s): type %s not implemented",
opt->desc->defname, xiohelp_opttypename(opt->desc->type));