Added option ai-all

This commit is contained in:
Gerhard Rieger 2024-02-17 11:57:55 +01:00
parent a6c8c3ad89
commit 93e6685766
6 changed files with 15 additions and 2 deletions

View file

@ -29,6 +29,8 @@ Features:
socat-mux.sh and socat-broker.sh, when run as root, now internally use socat-mux.sh and socat-broker.sh, when run as root, now internally use
low (512..1023) UDP ports to increase security. low (512..1023) UDP ports to increase security.
Added option ai-all (sets AI_ALL flag of getaddrinfo() resolver)
Porting: Porting:
Changes for building and testing on NetBSD Changes for building and testing on NetBSD

View file

@ -2566,8 +2566,11 @@ label(OPTION_AI_V4MAPPED)
dit(bf(tt(ai-v4mapped[=0|1]))) dit(bf(tt(v4mapped[=0|1]))) dit(bf(tt(ai-v4mapped[=0|1]))) dit(bf(tt(v4mapped[=0|1])))
Sets or unsets the AI_V4MAPPED flag for code(getaddrinfo()). With socat() Sets or unsets the AI_V4MAPPED flag for code(getaddrinfo()). With socat()
addresses requiring IPv6 addresses, this resolves IPv4 addresses to the addresses requiring IPv6 addresses, this resolves IPv4 addresses to the
approriate IPv6 address [::ffff:*:*]. For IPv6 Socat addresses, the default appropriate IPv6 address [::ffff:*:*]. For IPv6 socat() addresses, the
is 1. default is 1.
label(OPTION_AI_ALL)
dit(bf(tt(ai-all[=0|1])))
Sets or unsets the AI_ALL flag for code(getaddrinfo()).
label(OPTION_RES_DEBUG)dit(bf(tt(res-debug))) label(OPTION_RES_DEBUG)dit(bf(tt(res-debug)))
label(OPTION_RES_AAONLY)dit(bf(tt(res-aaonly))) label(OPTION_RES_AAONLY)dit(bf(tt(res-aaonly)))

View file

@ -84,6 +84,9 @@ const struct optdesc opt_ip_recvif = { "ip-recvif", "recvdstaddrif",OPT_IP_RECVI
#ifdef AI_ADDRCONFIG #ifdef AI_ADDRCONFIG
const struct optdesc opt_ai_addrconfig = { "ai-addrconfig", "addrconfig", OPT_AI_ADDRCONFIG, GROUP_SOCK_IP, PH_OFFSET, TYPE_BOOL, OFUNC_OFFSET_MASKS, XIO_OFFSETOF(para.socket.ip.ai_flags), XIO_SIZEOF(para.socket.ip.ai_flags), AI_ADDRCONFIG }; const struct optdesc opt_ai_addrconfig = { "ai-addrconfig", "addrconfig", OPT_AI_ADDRCONFIG, GROUP_SOCK_IP, PH_OFFSET, TYPE_BOOL, OFUNC_OFFSET_MASKS, XIO_OFFSETOF(para.socket.ip.ai_flags), XIO_SIZEOF(para.socket.ip.ai_flags), AI_ADDRCONFIG };
#endif #endif
#ifdef AI_ALL
const struct optdesc opt_ai_all = { "ai-all", NULL, OPT_AI_ALL, GROUP_SOCK_IP, PH_OFFSET, TYPE_BOOL, OFUNC_OFFSET_MASKS, XIO_OFFSETOF(para.socket.ip.ai_flags), XIO_SIZEOF(para.socket.ip.ai_flags), AI_ALL };
#endif
#ifdef AI_V4MAPPED #ifdef AI_V4MAPPED
const struct optdesc opt_ai_v4mapped = { "ai-v4mapped", "v4mapped", OPT_AI_V4MAPPED, GROUP_SOCK_IP, PH_OFFSET, TYPE_BOOL, OFUNC_OFFSET_MASKS, XIO_OFFSETOF(para.socket.ip.ai_flags), XIO_SIZEOF(para.socket.ip.ai_flags), AI_V4MAPPED }; const struct optdesc opt_ai_v4mapped = { "ai-v4mapped", "v4mapped", OPT_AI_V4MAPPED, GROUP_SOCK_IP, PH_OFFSET, TYPE_BOOL, OFUNC_OFFSET_MASKS, XIO_OFFSETOF(para.socket.ip.ai_flags), XIO_SIZEOF(para.socket.ip.ai_flags), AI_V4MAPPED };
#endif #endif

View file

@ -30,6 +30,7 @@ extern const struct optdesc opt_ip_recvif;
extern const struct optdesc opt_ip_transparent; extern const struct optdesc opt_ip_transparent;
extern const struct optdesc opt_ai_addrconfig; extern const struct optdesc opt_ai_addrconfig;
extern const struct optdesc opt_ai_all;
extern const struct optdesc opt_ai_passive; extern const struct optdesc opt_ai_passive;
extern const struct optdesc opt_ai_v4mapped; extern const struct optdesc opt_ai_v4mapped;

View file

@ -199,6 +199,9 @@ const struct optname optionnames[] = {
#if defined(AI_ADDRCONFIG) #if defined(AI_ADDRCONFIG)
IF_IP ("ai-addrconfig", &opt_ai_addrconfig) IF_IP ("ai-addrconfig", &opt_ai_addrconfig)
#endif #endif
#if defined(AI_ALL)
IF_IP ("ai-all", &opt_ai_all)
#endif
#if defined(AI_PASSIVE ) #if defined(AI_PASSIVE )
IF_IP ("ai-passive", &opt_ai_passive) IF_IP ("ai-passive", &opt_ai_passive)
#endif #endif

View file

@ -216,6 +216,7 @@ enum e_func {
enum e_optcode { enum e_optcode {
OPT_ADDRESS_FAMILY = 1, OPT_ADDRESS_FAMILY = 1,
OPT_AI_ADDRCONFIG, /* getaddrinfo() */ OPT_AI_ADDRCONFIG, /* getaddrinfo() */
OPT_AI_ALL, /* getaddrinfo() */
OPT_AI_PASSIVE, /* getaddrinfo() */ OPT_AI_PASSIVE, /* getaddrinfo() */
OPT_AI_V4MAPPED, /* getaddrinfo() */ OPT_AI_V4MAPPED, /* getaddrinfo() */
/* these are not alphabetically, I know... */ /* these are not alphabetically, I know... */