]> git.meshlink.io Git - meshlink/blobdiff - src/net_socket.c
Check if SO_REUSEPORT is defined before using it.
[meshlink] / src / net_socket.c
index abf6a7cf0e0eb7fa878f347efa45a6910c646927..dd02bf33bb7bbe26fed204c0066befa4f447005e 100644 (file)
@@ -378,6 +378,7 @@ begin:
                        /* We are waiting for a callback from the ADNS thread */
                } else if(outgoing->state == OUTGOING_NO_KNOWN_ADDRESSES) {
                        logger(mesh, MESHLINK_ERROR, "No known addresses for %s", outgoing->node->name);
+                       list_delete(mesh->outgoings, outgoing);
                } else {
                        logger(mesh, MESHLINK_ERROR, "Could not set up a meta connection to %s", outgoing->node->name);
                        retry_outgoing(mesh, outgoing);
@@ -524,6 +525,10 @@ void handle_new_meta_connection(event_loop_t *loop, void *data, int flags) {
        fd = accept(l->tcp.fd, &sa.sa, &len);
 
        if(fd < 0) {
+               if(sockwouldblock(errno)) {
+                       return;
+               }
+
                if(errno == EINVAL) { // TODO: check if Windows agrees
                        event_loop_stop(loop);
                        return;