]> git.meshlink.io Git - meshlink/blobdiff - src/net_setup.c
Don't use assert() to check the results of pthread_*() calls.
[meshlink] / src / net_setup.c
index 9cbdeb2691409f1c23c7221f0e9bf4af3d5b9b83..a82d5d97817610ca611195927a264713e4129141 100644 (file)
@@ -422,7 +422,7 @@ static bool add_listen_sockets(meshlink_handle_t *mesh) {
                .ai_family = AF_UNSPEC,
                .ai_socktype = SOCK_STREAM,
                .ai_protocol = IPPROTO_TCP,
-               .ai_flags = AI_PASSIVE,
+               .ai_flags = AI_PASSIVE | AI_NUMERICSERV,
        };
 
        int err = getaddrinfo(NULL, mesh->myport, &hint, &ai);
@@ -521,13 +521,7 @@ static bool add_listen_sockets(meshlink_handle_t *mesh) {
 /*
   Configure node_t mesh->self and set up the local sockets (listen only)
 */
-bool setup_myself(meshlink_handle_t *mesh) {
-       /* Set some defaults */
-
-       mesh->maxtimeout = 900;
-
-       /* Done */
-
+static bool setup_myself(meshlink_handle_t *mesh) {
        mesh->self->nexthop = mesh->self;
 
        node_add(mesh, mesh->self);