X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet_setup.c;h=125715180b7ffa941f40798610e68c7256a629f9;hb=f71ab70351e8d5dfdc91c9808d142cf93d2a5d61;hp=82f9bbcdfcd1eca64791fcd959ac5754549e70d5;hpb=0345a1468613e1ba4a4aa6dbbef44a26f1eb42d9;p=tinc diff --git a/src/net_setup.c b/src/net_setup.c index 82f9bbcd..12571518 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -935,6 +935,8 @@ static bool setup_myself(void) { logger(DEBUG_ALWAYS, LOG_ERR, "UDPRcvBuf cannot be negative!"); return false; } + + udp_rcvbuf_warnings = true; } if(get_config_int(lookup_config(config_tree, "UDPSndBuf"), &udp_sndbuf)) { @@ -942,6 +944,8 @@ static bool setup_myself(void) { logger(DEBUG_ALWAYS, LOG_ERR, "UDPSndBuf cannot be negative!"); return false; } + + udp_sndbuf_warnings = true; } get_config_int(lookup_config(config_tree, "FWMark"), &fwmark); @@ -1019,8 +1023,49 @@ static bool setup_myself(void) { /* Compression */ if(get_config_int(lookup_config(config_tree, "Compression"), &myself->incompression)) { - if(myself->incompression < 0 || myself->incompression > 11) { + switch(myself->incompression) { + case 12: +#ifdef HAVE_LZ4 + break; +#else + logger(DEBUG_ALWAYS, LOG_ERR, "Bogus compression level!"); + logger(DEBUG_ALWAYS, LOG_ERR, "LZ4 compression is unavailable on this node."); + return false; +#endif + + case 11: + case 10: +#ifdef HAVE_LZO + break; +#else + logger(DEBUG_ALWAYS, LOG_ERR, "Bogus compression level!"); + logger(DEBUG_ALWAYS, LOG_ERR, "LZO compression is unavailable on this node."); + return false; +#endif + + case 9: + case 8: + case 7: + case 6: + case 5: + case 4: + case 3: + case 2: + case 1: +#ifdef HAVE_ZLIB + break; +#else + logger(DEBUG_ALWAYS, LOG_ERR, "Bogus compression level!"); + logger(DEBUG_ALWAYS, LOG_ERR, "ZLIB compression is unavailable on this node."); + return false; +#endif + + case 0: + break; + + default: logger(DEBUG_ALWAYS, LOG_ERR, "Bogus compression level!"); + logger(DEBUG_ALWAYS, LOG_ERR, "Compression level %i is unrecognized by this node.", myself->incompression); return false; } } else { @@ -1285,7 +1330,7 @@ void close_network_connections(void) { if(myself && myself->connection) { subnet_update(myself, NULL, false); - connection_del(myself->connection); + free_connection(myself->connection); } for(int i = 0; i < listen_sockets; i++) {