mirror of
https://github.com/yrutschle/sslh.git
synced 2025-06-03 00:51:00 +03:00
fail as soon as a listen address cannot be resolved
This commit is contained in:
parent
219163ac27
commit
46d9796bd6
@ -147,9 +147,10 @@ void cmd_ssl_to_tls(int argc, char* argv[])
|
|||||||
#ifdef LIBCONFIG
|
#ifdef LIBCONFIG
|
||||||
static int config_resolve_listen(struct addrinfo **listen)
|
static int config_resolve_listen(struct addrinfo **listen)
|
||||||
{
|
{
|
||||||
int i;
|
int i, res;
|
||||||
for (i = 0; i < cfg.listen_len; i++) {
|
for (i = 0; i < cfg.listen_len; i++) {
|
||||||
resolve_split_name(listen, cfg.listen[i].host, cfg.listen[i].port);
|
res = resolve_split_name(listen, cfg.listen[i].host, cfg.listen[i].port);
|
||||||
|
if (res) return res;
|
||||||
|
|
||||||
/* getaddrinfo returned a list of addresses corresponding to the
|
/* getaddrinfo returned a list of addresses corresponding to the
|
||||||
* specification; move the pointer to the end of that list before
|
* specification; move the pointer to the end of that list before
|
||||||
@ -268,7 +269,8 @@ int main(int argc, char *argv[], char* envp[])
|
|||||||
if (!res) exit(1);
|
if (!res) exit(1);
|
||||||
if (cfg.verbose > 3)
|
if (cfg.verbose > 3)
|
||||||
sslhcfg_fprint(stderr, &cfg, 0);
|
sslhcfg_fprint(stderr, &cfg, 0);
|
||||||
config_resolve_listen(&addr_listen);
|
res = config_resolve_listen(&addr_listen);
|
||||||
|
if (res) exit(4);
|
||||||
config_protocols();
|
config_protocols();
|
||||||
config_sanity_check(&cfg);
|
config_sanity_check(&cfg);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user