]> git.meshlink.io Git - meshlink/commitdiff
Allow UDP packets with an address different from the corresponding TCP connection.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 24 Oct 2009 18:54:44 +0000 (20:54 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 24 Oct 2009 18:54:44 +0000 (20:54 +0200)
src/net_packet.c

index 9b0e4685012491e75f25d3bd06e8e40ee0fd2a95..7bf12497f640dfd0f538e923ca8a52aadac80799 100644 (file)
@@ -521,12 +521,16 @@ static node_t *try_harder(const sockaddr_t *from, const vpn_packet_t *pkt) {
        avl_node_t *node;
        edge_t *e;
        node_t *n = NULL;
+       static time_t last_hard_try = 0;
 
        for(node = edge_weight_tree->head; node; node = node->next) {
                e = node->data;
 
-               if(sockaddrcmp_noport(from, &e->address))
-                       continue;
+               if(sockaddrcmp_noport(from, &e->address)) {
+                       if(last_hard_try == now)
+                               continue;
+                       last_hard_try = now;
+               }
 
                if(!n)
                        n = e->to;