X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=d1d5c04be36ff5bfbbe002b106551a789a1635f2;hb=0c010ff9fe50b4046b5c7977bafac3e74037f075;hp=1ae5edf8cc996c87f595d661202b98a447a79408;hpb=6056f1c13bb37bf711dff9c25a6eaea99f14d31f;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index 1ae5edf8..d1d5c04b 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -137,10 +137,11 @@ bool read_ecdsa_public_key(connection_t *c) { } c->ecdsa = ecdsa_read_pem_public_key(fp); - fclose(fp); - if(!c->ecdsa) + if(!c->ecdsa && errno != ENOENT) logger(DEBUG_ALWAYS, LOG_ERR, "Parsing Ed25519 public key file `%s' failed.", fname); + + fclose(fp); free(fname); return c->ecdsa; } @@ -663,6 +664,9 @@ static bool add_listen_address(char *address, bool bindto) { hint.ai_protocol = IPPROTO_TCP; hint.ai_flags = AI_PASSIVE; +#ifdef HAVE_DECL_RES_INIT + res_init(); +#endif int err = getaddrinfo(address && *address ? address : NULL, port, &hint, &ai); free(address);