mirror of
https://github.com/yrutschle/sslh.git
synced 2025-06-02 08:31:06 +03:00
add functionality
Signed-off-by: Paul Schroeder <milkpirate@users.noreply.github.com>
This commit is contained in:
parent
875fa488c9
commit
87577ae5f6
5
common.c
5
common.c
@ -319,6 +319,11 @@ int connect_addr(struct connection *cnx, int fd_from, connect_blocking blocking)
|
||||
res = getpeername(fd_from, from.ai_addr, &from.ai_addrlen);
|
||||
CHECK_RES_RETURN(res, "getpeername", res);
|
||||
|
||||
if (cfg.protocols.resolve_on_forward) {
|
||||
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)
|
||||
|
@ -124,8 +124,13 @@ static void config_protocols()
|
||||
int i;
|
||||
for (i = 0; i < cfg.protocols_len; i++) {
|
||||
struct sslhcfg_protocols_item* p = &(cfg.protocols[i]);
|
||||
if (resolve_split_name(&(p->saddr), p->host, p->port)) {
|
||||
print_message(msg_config_error, "cannot resolve %s:%s\n", p->host, p->port);
|
||||
|
||||
if (
|
||||
!cfg.protocols.resolve_on_forward &&
|
||||
resolve_split_name(&(p->saddr), p->host, p->port)
|
||||
) {
|
||||
print_message(msg_config_error, "cannot resolve %s:%s\n",
|
||||
p->host, p->port);
|
||||
exit(4);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user