- /* 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 */
-
- if(c->outgoing) {
- if(strcmp(c->name, name)) {
- logger(LOG_ERR, "Peer %s is %s instead of %s", c->hostname, name,
- c->name);
+ case PROXY_SOCKS4: {
+ if(c->address.sa.sa_family != AF_INET) {
+ logger(mesh, MESHLINK_ERROR, "Cannot connect to an IPv6 host through a SOCKS 4 proxy!");