}
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);
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;
}
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);
}
}