return false;
}
+ bool success = false;
+
for(struct addrinfo *aip = ai; aip; aip = aip->ai_next) {
// Ignore duplicate addresses
bool found = false;
mesh->listen_socket[mesh->listen_sockets].bindto = bindto;
memcpy(&mesh->listen_socket[mesh->listen_sockets].sa, aip->ai_addr, aip->ai_addrlen);
mesh->listen_sockets++;
+ success = true;
}
freeaddrinfo(ai);
- return true;
+ return success;
}
/*
mesh->listen_sockets = 0;
if(!add_listen_address(mesh, address, NULL)) {
- if(!strcmp(mesh->myport, "0")) {
- logger(mesh, MESHLINK_WARNING, "Could not bind to port %s, asking OS to choose one for us", mesh->myport);
+ if(strcmp(mesh->myport, "0")) {
+ logger(mesh, MESHLINK_INFO, "Could not bind to port %s, asking OS to choose one for us", mesh->myport);
free(mesh->myport);
mesh->myport = strdup("0");
if(!mesh->myport)