Don't send UDP probes past static relays.
[tinc] / src / protocol_key.c
index cfa2f53..8cbec1b 100644 (file)
@@ -303,6 +303,8 @@ bool send_ans_key(node_t *to) {
        to->received = 0;
        if(replaywin) memset(to->late, 0, replaywin);
 
+       to->status.validkey_in = true;
+
        return send_request(to->nexthop->connection, "%d %s %s %s %d %d %d %d", ANS_KEY,
                                                myself->name, to->name, key,
                                                cipher_get_nid(to->incipher),
@@ -404,18 +406,13 @@ bool ans_key_h(connection_t *c, const char *request) {
                                sockaddr_t sa = str2sockaddr(address, port);
                                update_node_udp(from, &sa);
                        }
-
-                       /* Don't send probes if we can't send UDP packets directly to that node.
-                          TODO: the indirect (via) condition can change at any time as edges are added and removed, so this should probably be moved to graph.c. */
-                       if((from->via == myself || from->via == from) && from->options & OPTION_PMTU_DISCOVERY && !(from->options & OPTION_TCPONLY))
-                               send_mtu_probe(from);
                }
 
                return true;
        }
 
 #ifdef DISABLE_LEGACY
-       logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%) uses legacy protocol!", from->name, from->hostname);
+       logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses legacy protocol!", from->name, from->hostname);
        return false;
 #else
        /* Check and lookup cipher and digest algorithms */
@@ -468,9 +465,6 @@ bool ans_key_h(connection_t *c, const char *request) {
                update_node_udp(from, &sa);
        }
 
-       if(from->options & OPTION_PMTU_DISCOVERY && !(from->options & OPTION_TCPONLY))
-               send_mtu_probe(from);
-
        return true;
 #endif
 }