1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-26 12:02:58 +00:00

TCP based clients try all results of name resolution until a connection succeeded

This commit is contained in:
Gerhard Rieger 2023-10-22 23:15:49 +02:00
parent 2a9623d61c
commit cb6e16b360
16 changed files with 456 additions and 262 deletions

View file

@ -145,7 +145,7 @@ int _xioopen_listen(struct single *xfd, int xioflags, struct sockaddr *us, sockl
xiosetchilddied(); /* set SIGCHLD handler */
}
if ((xfd->fd = xiosocket(opts, us->sa_family, socktype, proto, level)) < 0) {
if ((xfd->fd = xiosocket(opts, pf?pf:us->sa_family, socktype, proto, level)) < 0) {
return STAT_RETRYLATER;
}
applyopts(xfd->fd, opts, PH_PASTSOCKET);
@ -199,8 +199,7 @@ int _xioopen_listen(struct single *xfd, int xioflags, struct sockaddr *us, sockl
#if WITH_IP4 /*|| WITH_IP6*/
if (retropt_string(opts, OPT_RANGE, &rangename) >= 0) {
if (xioparserange(rangename, pf, &xfd->para.socket.range)
< 0) {
if (xioparserange(rangename, pf, &xfd->para.socket.range) < 0) {
free(rangename);
return STAT_NORETRY;
}