From f695ec9df8ad0f8521ea405559a723dd57ed80a2 Mon Sep 17 00:00:00 2001 From: Saverio Proto Date: Fri, 23 May 2014 10:48:18 +0200 Subject: [PATCH] Dont setup outgoing connection to blacklisted nodes --- src/net_socket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/net_socket.c b/src/net_socket.c index 3cbc5dd6..2ddf837b 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -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); -- 2.39.5