]> git.meshlink.io Git - meshlink/commitdiff
Dont setup outgoing connection to blacklisted nodes
authorSaverio Proto <zioproto@gmail.com>
Fri, 23 May 2014 08:48:18 +0000 (10:48 +0200)
committerSaverio Proto <zioproto@gmail.com>
Fri, 23 May 2014 08:48:18 +0000 (10:48 +0200)
src/net_socket.c

index 3cbc5dd634fa2d60d302daab5a0959b9c16d9b17..2ddf837b0a357589df87b280ccb9c512dfa6880b 100644 (file)
@@ -503,6 +503,7 @@ static struct addrinfo *get_known_addresses(node_t *n) {
 }
 
 void setup_outgoing_connection(meshlink_handle_t *mesh, outgoing_t *outgoing) {
+       bool blacklisted = false;
        timeout_del(&mesh->loop, &outgoing->ev);
 
        node_t *n = lookup_node(mesh, outgoing->name);
@@ -518,6 +519,9 @@ void setup_outgoing_connection(meshlink_handle_t *mesh, outgoing_t *outgoing) {
        read_host_config(mesh, outgoing->config_tree, outgoing->name);
        outgoing->cfg = lookup_config(outgoing->config_tree, "Address");
 
+       get_config_bool(lookup_config(outgoing->config_tree, "blacklisted"), &blacklisted);
+       if (blacklisted) return;
+
        if(!outgoing->cfg) {
                if(n)
                        outgoing->aip = outgoing->ai = get_known_addresses(n);