X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fmeshlink.c;h=9aca06779a699e17bc667b233571861f507c3b36;hp=22f5220d4beebe6c19d6612d45923602e0e78061;hb=91169c529883e08d7a0245b709483a22a83245ad;hpb=47a69d3c93a292cf6fe8076e8fe8f3eb23d76da3 diff --git a/src/meshlink.c b/src/meshlink.c index 22f5220d..9aca0677 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -257,7 +257,7 @@ char *meshlink_get_external_address_for_family(meshlink_handle_t *mesh, int fami } logger(mesh, MESHLINK_DEBUG, "Trying to discover externally visible hostname...\n"); - struct addrinfo *ai = adns_blocking_request(mesh, xstrdup(host), xstrdup(port ? port : "80"), 5); + struct addrinfo *ai = adns_blocking_request(mesh, xstrdup(host), xstrdup(port ? port : "80"), SOCK_STREAM, 5); char line[256]; char *hostname = NULL; @@ -501,7 +501,7 @@ static char *get_my_hostname(meshlink_handle_t *mesh, uint32_t flags) { } // Convert what we have to a sockaddr - struct addrinfo *ai_in = adns_blocking_request(mesh, xstrdup(hostname[i]), xstrdup(port[i]), 5); + struct addrinfo *ai_in = adns_blocking_request(mesh, xstrdup(hostname[i]), xstrdup(port[i]), SOCK_STREAM, 5); if(!ai_in) { continue; @@ -2887,11 +2887,11 @@ bool meshlink_join(meshlink_handle_t *mesh, const char *invitation) { } // Connect to the meshlink daemon mentioned in the URL. - struct addrinfo *ai = adns_blocking_request(mesh, xstrdup(address), xstrdup(port), 5); + struct addrinfo *ai = adns_blocking_request(mesh, xstrdup(address), xstrdup(port), SOCK_STREAM, 5); if(ai) { for(struct addrinfo *aip = ai; aip; aip = aip->ai_next) { - state.sock = socket_in_netns(aip->ai_family, aip->ai_socktype, aip->ai_protocol, mesh->netns); + state.sock = socket_in_netns(aip->ai_family, SOCK_STREAM, IPPROTO_TCP, mesh->netns); if(state.sock == -1) { logger(mesh, MESHLINK_DEBUG, "Could not open socket: %s\n", strerror(errno));