X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_edge.c;h=9d439225678b12d1afdfcd66774c8ef2d346be73;hb=3a925479c2883a6a9711f7b6931863d7f2a2c09b;hp=57e202f605ff8719535dd85c168ee207c71b9574;hpb=4c85542894f7fca823b119b05e07179deb24229a;p=tinc 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;