From: Saverio Proto Date: Fri, 23 May 2014 08:48:18 +0000 (+0200) Subject: Dont setup outgoing connection to blacklisted nodes X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=f695ec9df8ad0f8521ea405559a723dd57ed80a2;p=meshlink Dont setup outgoing connection to blacklisted nodes --- 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);