- if(experimental) {
- if(c->config_tree && !read_ecdsa_public_key(c))
- minor = 1;
- else
- minor = myself->connection->protocol_minor;
- }
-
- return send_request(c, "%d %s %d.%d", ID, myself->connection->name, myself->connection->protocol_major, minor);
-}
-
-bool id_h(connection_t *c, char *request) {
- char name[MAX_STRING_SIZE];
-
- if(sscanf(request, "%*d " MAX_STRING " %d.%d", name, &c->protocol_major, &c->protocol_minor) < 2) {
- logger(LOG_ERR, "Got bad %s from %s (%s)", "ID", c->name,
- c->hostname);
- 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)) {
- logger(LOG_ERR, "Got bad %s from %s (%s): %s", "ID", c->name,
- c->hostname, "invalid name");
- return false;
- }
-
- /* If this is an outgoing connection, make sure we are connected to the right host */