X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=85272301c4e3a1cfadf5e1e8862a9f75b2a0357b;hb=edebf579f2ea29e6e84360cb13731f5858a1555b;hp=a38b9adffe6c876e0dad6a4e484353cd2426d2ec;hpb=c388527e341658dc915dd67c90bbc9b52b8539c0;p=tinc diff --git a/src/protocol_auth.c b/src/protocol_auth.c index a38b9adf..85272301 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -23,6 +23,8 @@ #include "splay_tree.h" #include "conf.h" #include "connection.h" +#include "control.h" +#include "control_common.h" #include "crypto.h" #include "edge.h" #include "graph.h" @@ -51,6 +53,15 @@ bool id_h(connection_t *c, char *request) { return false; } + /* Check if this is a control connection */ + + if(name[0] == '^' && !strcmp(name + 1, controlcookie)) { + c->status.control = true; + c->allow_request = CONTROL; + c->last_ping_time = time(NULL) + 3600; + return send_request(c, "%d %d %d", ACK, TINC_CTL_VERSION_CURRENT, getpid()); + } + /* Check if identity is a valid name */ if(!check_id(name)) {