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

Added AI_PASSIVE handling and option ai-passive

This commit is contained in:
Gerhard Rieger 2023-11-05 13:58:07 +01:00
parent 4e00a345b4
commit 2d282f5608
8 changed files with 60 additions and 6 deletions

View file

@ -259,14 +259,22 @@ int _xioopen_ipapp_listen_prepare(
int socktype)
{
char *bindname = NULL;
int ai_flags2[2];
int result;
retropt_socket_pf(opts, pf);
retropt_string(opts, OPT_BIND, &bindname);
/* Set AI_PASSIVE, except when it is explicitely disabled */
ai_flags2[0] = ai_flags[0];
ai_flags2[1] = ai_flags[1];
if (!(ai_flags2[1] & AI_PASSIVE))
ai_flags2[0] |= AI_PASSIVE;
result =
xioresolve(bindname, portname, *pf, socktype, ipproto,
us, uslen, ai_flags, res_opts);
us, uslen, ai_flags2, res_opts);
if (result != STAT_OK) {
/*! STAT_RETRY? */
return result;