Florian Klink
2015-Jul-02 10:35 UTC
[PATCH 1/2] (read|append)_config_file: log open errors as LOG_DEBUG
In a "decentrally managed vpn" it is very likely that host config files for some reachable nodes do not exist. Currently, tinc fills the logs with "Cannot open config file" messages. This commit changes the log level to LOG_DEBUG so syslog doesn't get filled by default. --- src/conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf.c b/src/conf.c index 2b32359..7756247 100644 --- a/src/conf.c +++ b/src/conf.c @@ -298,7 +298,7 @@ bool read_config_file(splay_tree_t *config_tree, const char *fname) { fp = fopen(fname, "r"); if(!fp) { - logger(DEBUG_ALWAYS, LOG_ERR, "Cannot open config file %s: %s", fname, strerror(errno)); + logger(DEBUG_ALWAYS, LOG_DEBUG, "Cannot open config file %s: %s", fname, strerror(errno)); return false; } @@ -423,7 +423,7 @@ bool append_config_file(const char *name, const char *key, const char *value) { FILE *fp = fopen(fname, "a"); if(!fp) { - logger(DEBUG_ALWAYS, LOG_ERR, "Cannot open config file %s: %s", fname, strerror(errno)); + logger(DEBUG_ALWAYS, LOG_DEBUG, "Cannot open config file %s: %s", fname, strerror(errno)); return false; } -- 2.4.4
Florian Klink
2015-Jul-02 10:35 UTC
[PATCH 2/2] setup_outgoing_connection: log to LOG_DEBUG on if no known address
With AutoConnect = yes, tinc tries to establish connections to known hosts. However, you could have set no Address for this host, which is perfectly fine (as long as there is at least one bootstrap node with an address or a local discovered node already part of the network) So log this to LOG_DEBUG --- src/net_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net_socket.c b/src/net_socket.c index 526d382..97d6c44 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -617,7 +617,7 @@ void setup_outgoing_connection(outgoing_t *outgoing) { if(n) outgoing->aip = outgoing->ai = get_known_addresses(n); if(!outgoing->ai) { - logger(DEBUG_ALWAYS, LOG_ERR, "No address known for %s", outgoing->name); + logger(DEBUG_ALWAYS, LOG_DEBUG, "No address known for %s", outgoing->name); return; } } -- 2.4.4