Don't spontaneously start SPTPS with neighbors.
authorEtienne Dechamps <etienne@edechamps.fr>
Sun, 12 Oct 2014 10:41:08 +0000 (11:41 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Thu, 25 Dec 2014 16:55:46 +0000 (17:55 +0100)
Currently, when tinc establishes a metaconnection, it automatically
starts a VPN SPTPS tunnel with the other side of the metaconnection.

It is not clear what this is trying to accomplish. Having a
metaconnection with a node does not necessarily mean we're going to send
packets to that node. This patch removes this behavior, thereby
simplifying code paths and removing unnecessary network chatter.

Naturally, this introduces a slight delay (as well as at least one
initial packet loss) between the moment a metaconnection is established
and the moment VPN packets can be exchanged between the two nodes.
However this is no different to the non-neighbor case, so it makes
things more consistent and therefore easier to reason about.

src/graph.c

index 690f4bd53fd30ed5caf2894432049b2ca1f48965..70d65731d1b78d886a100cfff7cc29bf5f980802 100644 (file)
@@ -275,13 +275,6 @@ static void check_reachability(void) {
                                update_node_udp(n, NULL);
                                memset(&n->status, 0, sizeof n->status);
                                n->options = 0;
-                       } else if(n->connection) {
-                               if(n->status.sptps) {
-                                       if(n->connection->outgoing)
-                                               send_req_key(n);
-                               } else {
-                                       send_ans_key(n);
-                               }
                        }
                }