X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=fee4159fabc16ed9bfb096452e8cd4cb12f14514;hb=7027bba541eca3e34f689bebd6f6e408ba4e7710;hp=1ae5edf8cc996c87f595d661202b98a447a79408;hpb=6056f1c13bb37bf711dff9c25a6eaea99f14d31f;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index 1ae5edf8..fee4159f 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); @@ -850,14 +854,14 @@ static bool setup_myself(void) { } if(get_config_int(lookup_config(config_tree, "UDPRcvBuf"), &udp_rcvbuf)) { - if(udp_rcvbuf <= 0) { + if(udp_rcvbuf < 0) { logger(DEBUG_ALWAYS, LOG_ERR, "UDPRcvBuf cannot be negative!"); return false; } } if(get_config_int(lookup_config(config_tree, "UDPSndBuf"), &udp_sndbuf)) { - if(udp_sndbuf <= 0) { + if(udp_sndbuf < 0) { logger(DEBUG_ALWAYS, LOG_ERR, "UDPSndBuf cannot be negative!"); return false; }