X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol_edge.c;h=9d439225678b12d1afdfcd66774c8ef2d346be73;hp=57e202f605ff8719535dd85c168ee207c71b9574;hb=2762509be179dcb21d855f3d6f90d3ee686e3910;hpb=5cddf5e52aeb20e50c887356ad23aec354e04151 diff --git a/src/protocol_edge.c b/src/protocol_edge.c index 57e202f6..9d439225 100644 --- a/src/protocol_edge.c +++ b/src/protocol_edge.c @@ -70,13 +70,7 @@ bool add_edge_h(connection_t *c) { /* Check if names are valid */ - if(!check_id(from_name)) { - logger(LOG_ERR, "Got bad %s from %s (%s): %s", "ADD_EDGE", c->name, - c->hostname, "invalid name"); - return false; - } - - if(!check_id(to_name)) { + if(!check_id(from_name) || !check_id(to_name)) { logger(LOG_ERR, "Got bad %s from %s (%s): %s", "ADD_EDGE", c->name, c->hostname, "invalid name"); return false; @@ -186,13 +180,7 @@ bool del_edge_h(connection_t *c) { /* Check if names are valid */ - if(!check_id(from_name)) { - logger(LOG_ERR, "Got bad %s from %s (%s): %s", "DEL_EDGE", c->name, - c->hostname, "invalid name"); - return false; - } - - if(!check_id(to_name)) { + if(!check_id(from_name) || !check_id(to_name)) { logger(LOG_ERR, "Got bad %s from %s (%s): %s", "DEL_EDGE", c->name, c->hostname, "invalid name"); return false;