]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
Never call timeout_set() outside callbacks if no callback is set.
[meshlink] / src / meshlink.c
index ee62078d8b16a55a31c363eb3d77f01fdbdb5b63..009839314cba71ca319455d657896c4d8bcd9cd1 100644 (file)
@@ -3456,6 +3456,10 @@ static bool blacklist(meshlink_handle_t *mesh, node_t *n) {
         */
        for list_each(connection_t, c, mesh->connections) {
                if(c->node == n) {
+                       if(c->status.active) {
+                               send_error(mesh, c, BLACKLISTED, "blacklisted");
+                       }
+
                        shutdown(c->socket, SHUT_RDWR);
                }
        }
@@ -3859,7 +3863,7 @@ static void channel_retransmit(struct utcp_connection *utcp_connection) {
        node_t *n = utcp_connection->utcp->priv;
        meshlink_handle_t *mesh = n->mesh;
 
-       if(n->mtuprobes == 31) {
+       if(n->mtuprobes == 31 && n->mtutimeout.cb) {
                timeout_set(&mesh->loop, &n->mtutimeout, &(struct timespec) {
                        0, 0
                });