X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;h=13719f52fbdf307581ef202c2638bbdc7b8269f5;hp=17c042520c2056909e2a5a5190a7bd6a8ee6031f;hb=2116c6eb7d328c7aa3ce3da54f95367e5199d373;hpb=3fae14fae5a347823679ef694ab630b4991a201d diff --git a/src/net_setup.c b/src/net_setup.c index 17c04252..13719f52 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -76,7 +76,7 @@ bool read_rsa_public_key(connection_t *c) { /* First, check for simple PublicKey statement */ if(get_config_string(lookup_config(c->config_tree, "PublicKey"), &key)) { - if(BN_hex2bn(&n, key) != strlen(key)) { + if((size_t)BN_hex2bn(&n, key) != strlen(key)) { free(key); logger(LOG_ERR, "Invalid PublicKey for %s!", c->name); return false; @@ -191,7 +191,7 @@ static bool read_rsa_private_key(void) { myself->connection->rsa_key = RSA_new(); // RSA_blinding_on(myself->connection->rsa_key, NULL); - if(BN_hex2bn(&d, key) != strlen(key)) { + if((size_t)BN_hex2bn(&d, key) != strlen(key)) { logger(LOG_ERR, "Invalid PrivateKey for myself!"); free(key); return false; @@ -205,7 +205,7 @@ static bool read_rsa_private_key(void) { return false; } - if(BN_hex2bn(&n, pubkey) != strlen(pubkey)) { + if((size_t)BN_hex2bn(&n, pubkey) != strlen(pubkey)) { free(pubkey); BN_free(d); logger(LOG_ERR, "Invalid PublicKey for myself!"); @@ -388,8 +388,8 @@ static bool setup_myself(void) { char *address = NULL; char *proxy = NULL; char *space; - char *envp[5] = {NULL}; - struct addrinfo *ai, *aip, hint = {0}; + char *envp[5] = {}; + struct addrinfo *ai, *aip, hint = {}; bool choice; int i, err; int replaywin_int; @@ -588,7 +588,7 @@ static bool setup_myself(void) { free(mode); } - choice = true; + choice = !(myself->options & OPTION_TCPONLY); get_config_bool(lookup_config(config_tree, "PMTUDiscovery"), &choice); if(choice) { @@ -1068,7 +1068,7 @@ bool setup_network(void) { void close_network_connections(void) { avl_node_t *node, *next; connection_t *c; - char *envp[5] = {NULL}; + char *envp[5] = {}; int i; for(node = connection_tree->head; node; node = next) {