X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnode.c;h=e6b9f018f46657519b7cceab1939b139ad6f010b;hb=0d98bd49718a6622d5ef2d17455c60cc075f938e;hp=edf2c85809134bc55581b7a9b5d46d562c2be663;hpb=6d1ac53f5c34ece4c7a82efb432a8e1d81fcff0d;p=meshlink diff --git a/src/node.c b/src/node.c index edf2c858..e6b9f018 100644 --- a/src/node.c +++ b/src/node.c @@ -105,10 +105,8 @@ void node_del(meshlink_handle_t *mesh, node_t *n) { } node_t *lookup_node(meshlink_handle_t *mesh, const char *name) { - node_t n = {NULL}; - node_t* result; - - n.name = name; + const node_t n = {.name = (char *)name}; + node_t *result; pthread_mutex_lock(&(mesh->nodes_mutex)); result = splay_search(mesh->nodes, &n); @@ -123,7 +121,7 @@ node_t *lookup_node_udp(meshlink_handle_t *mesh, const sockaddr_t *sa) { void update_node_udp(meshlink_handle_t *mesh, node_t *n, const sockaddr_t *sa) { if(n == mesh->self) { - logger(DEBUG_ALWAYS, LOG_WARNING, "Trying to update UDP address of mesh->self!"); + logger(mesh, MESHLINK_WARNING, "Trying to update UDP address of mesh->self!"); return; } @@ -141,6 +139,6 @@ void update_node_udp(meshlink_handle_t *mesh, node_t *n, const sockaddr_t *sa) { hash_insert(mesh->node_udp_cache, sa, n); free(n->hostname); n->hostname = sockaddr2hostname(&n->address); - logger(DEBUG_PROTOCOL, LOG_DEBUG, "UDP address of %s set to %s", n->name, n->hostname); + logger(mesh, MESHLINK_DEBUG, "UDP address of %s set to %s", n->name, n->hostname); } }