diff --git a/common.c b/common.c index 9ea1516..c4d0178 100644 --- a/common.c +++ b/common.c @@ -337,11 +337,8 @@ int set_nonblock(int fd) } -/* Connect to first address that works and returns a file descriptor, or -1 if - * none work. - * If transparent proxying is on, use fd_from peer address on external address - * of new file descriptor. */ -int connect_addr(struct connection *cnx, int fd_from, connect_blocking blocking) +/* Connects to INET/INET6 domain sockets and return a fd */ +static int connect_inet(struct connection *cnx, int fd_from, connect_blocking blocking) { struct addrinfo *a, from; struct sockaddr_storage ss; @@ -360,7 +357,6 @@ int connect_addr(struct connection *cnx, int fd_from, connect_blocking blocking) resolve_split_name(&(cnx->proto->saddr), cnx->proto->host, cnx->proto->port); } - for (a = cnx->proto->saddr; a; a = a->ai_next) { /* When transparent, make sure both connections use the same address family */ if (transparent && a->ai_family != from.ai_addr->sa_family) @@ -408,6 +404,18 @@ int connect_addr(struct connection *cnx, int fd_from, connect_blocking blocking) return -1; } + +/* Connect to first address that works and returns a file descriptor, or -1 if + * none work. + * If transparent proxying is on, use fd_from peer address on external address + * of new file descriptor. */ +int connect_addr(struct connection *cnx, int fd_from, connect_blocking blocking) +{ + int fd = connect_inet(cnx, fd_from, blocking); + + return fd; +} + /* Store some data to write to the queue later */ int defer_write(struct queue *q, void* data, ssize_t data_size) { diff --git a/echosrv-conf.c b/echosrv-conf.c index 1f3a1b2..fc0b3f7 100644 --- a/echosrv-conf.c +++ b/echosrv-conf.c @@ -1,5 +1,5 @@ /* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README) - * on Sun Sep 8 23:10:29 2024. + * on Sun Dec 22 00:05:31 2024. # conf2struct: generate libconf parsers that read to structs # Copyright (C) 2018-2024 Yves Rutschle diff --git a/echosrv-conf.h b/echosrv-conf.h index 4cec9a5..e42361b 100644 --- a/echosrv-conf.h +++ b/echosrv-conf.h @@ -1,5 +1,5 @@ /* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README) - * on Sun Sep 8 23:10:29 2024. + * on Sun Dec 22 00:05:31 2024. # conf2struct: generate libconf parsers that read to structs # Copyright (C) 2018-2024 Yves Rutschle diff --git a/sslh-conf.c b/sslh-conf.c index 70274a0..ed4ab75 100644 --- a/sslh-conf.c +++ b/sslh-conf.c @@ -1,5 +1,5 @@ /* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README) - * on Sun Sep 8 23:10:29 2024. + * on Sun Dec 22 00:05:31 2024. # conf2struct: generate libconf parsers that read to structs # Copyright (C) 2018-2024 Yves Rutschle diff --git a/sslh-conf.h b/sslh-conf.h index 62c1e84..205a306 100644 --- a/sslh-conf.h +++ b/sslh-conf.h @@ -1,5 +1,5 @@ /* Generated by conf2struct (https://www.rutschle.net/tech/conf2struct/README) - * on Sun Sep 8 23:10:29 2024. + * on Sun Dec 22 00:05:31 2024. # conf2struct: generate libconf parsers that read to structs # Copyright (C) 2018-2024 Yves Rutschle diff --git a/version.h b/version.h index 46523c6..5b41ac4 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #ifndef VERSION_H #define VERSION_H -#define VERSION "v2.1.1-50-g686d1f7-dirty" +#define VERSION "v2.1.4-21-g16ef412-dirty" #endif