Use the correct originator node when relaying SPTPS UDP packets.
[tinc] / src / net_packet.c
index 2e47df4..27a6542 100644 (file)
@@ -64,7 +64,7 @@ static char lzo_wrkmem[LZO1X_999_MEM_COMPRESS > LZO1X_1_MEM_COMPRESS ? LZO1X_999
 
 static void send_udppacket(node_t *, vpn_packet_t *);
 
-unsigned replaywin = 16;
+unsigned replaywin = 32;
 bool localdiscovery = true;
 bool udp_discovery = true;
 int udp_discovery_keepalive_interval = 10;
@@ -1135,7 +1135,7 @@ static void try_tx_sptps(node_t *n, bool mtu) {
        /* If we do have a static relay, try everything with that one instead. */
 
        if(via != n)
-               try_tx_sptps(via, mtu);
+               return try_tx_sptps(via, mtu);
 
        /* Otherwise, try to establish UDP connectivity. */
 
@@ -1404,8 +1404,8 @@ skip_harder:
                /* If we're not the final recipient, relay the packet. */
 
                if(to != myself) {
-                       send_sptps_data_priv(to, n, 0, DATA(&pkt), pkt.len - 2 * sizeof(node_id_t));
-                       try_tx_sptps(n, true);
+                       send_sptps_data_priv(to, from, 0, DATA(&pkt), pkt.len - 2 * sizeof(node_id_t));
+                       try_tx_sptps(to, true);
                        return;
                }
        } else {