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

Fixed ignoring of explicit socksport in socks5 addresses (regression)

This commit is contained in:
Gerhard Rieger 2025-01-29 21:59:56 +01:00
parent 5e56f25285
commit e7df880af5
4 changed files with 10 additions and 1 deletions

View file

@ -239,7 +239,8 @@ int _xioopen_opt_socksport(
{
struct servent *se;
if (retropt_string(opts, OPT_SOCKSPORT, socksport) < 0) {
if (retropt_string(opts, OPT_SOCKSPORT, socksport) < 0 &&
*socksport == NULL) {
if ((se = getservbyname("socks", "tcp")) != NULL) {
Debug1("\"socks/tcp\" resolves to %u", ntohs(se->s_port));
if ((*socksport = Malloc(6)) == NULL) {