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

index 3cbc5dd634fa2d60d302daab5a0959b9c16d9b17..2564a9c1bd264460cd1d3028b64c3234ffa04090 100644 (file)
@@ -658,6 +658,7 @@ void try_outgoing_connections(meshlink_handle_t *mesh) {
        // TODO: Drop support for ConnectTo since AutoConnect is now always on?
        for(config_t *cfg = lookup_config(mesh->config, "ConnectTo"); cfg; cfg = lookup_config_next(mesh->config, cfg)) {
                char *name;
+               bool blacklisted;
                get_config_string(cfg, &name);
 
                if(!check_id(name)) {
@@ -668,6 +669,10 @@ void try_outgoing_connections(meshlink_handle_t *mesh) {
                        continue;
                }
 
+               get_config_bool(lookup_config(mesh->config, "blacklisted"), &blacklisted);
+               if (blacklisted)
+                       continue;
+
                bool found = false;
 
                for list_each(outgoing_t, outgoing, mesh->outgoings) {