]> git.meshlink.io Git - meshlink/blobdiff - src/net_setup.c
object-oriented interface 1st durchstich, incl. chat program adopted. :-)
[meshlink] / src / net_setup.c
index 7f3358168d5891abb1c515cd47d0279557f1adef..ce9a59ad230b0723e5bafeed12f312fed629b4a5 100644 (file)
@@ -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)