X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet_setup.c;h=ce9a59ad230b0723e5bafeed12f312fed629b4a5;hb=8bb44d97e49251dbf4c8d6b66956b91c7d2144cf;hp=7f3358168d5891abb1c515cd47d0279557f1adef;hpb=82a9712857c5b640288174493905499093853997;p=meshlink diff --git a/src/net_setup.c b/src/net_setup.c index 7f335816..ce9a59ad 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -269,7 +269,7 @@ bool setup_myself(meshlink_handle_t *mesh) { char *address = NULL; if(!(name = get_name(mesh))) { - logger(DEBUG_ALWAYS, LOG_ERR, "Name for tinc daemon required!"); + logger(DEBUG_ALWAYS, LOG_ERR, "Name for MeshLink instance required!"); return false; } @@ -377,11 +377,13 @@ bool setup_network(meshlink_handle_t *mesh) { close all open network connections */ void close_network_connections(meshlink_handle_t *mesh) { - for(list_node_t *node = mesh->connections->head, *next; node; node = next) { - next = node->next; - connection_t *c = node->data; - c->outgoing = NULL; - terminate_connection(mesh, c, false); + if(mesh->connections) { + for(list_node_t *node = mesh->connections->head, *next; node; node = next) { + next = node->next; + connection_t *c = node->data; + c->outgoing = NULL; + terminate_connection(mesh, c, false); + } } if(mesh->outgoings)