Fix UDP/MTU discovery in intermediate SPTPS UDP relays.
authorEtienne Dechamps <etienne@edechamps.fr>
Sun, 8 Mar 2015 14:32:01 +0000 (14:32 +0000)
committerEtienne Dechamps <etienne@edechamps.fr>
Sun, 8 Mar 2015 14:40:27 +0000 (14:40 +0000)
Refactoring commit 81578484dc74fd92f1b01f71f882016f120ab1de seems to
have introduced a regression as it moved discovery code away from
send_sptps_data_priv() and within send_packet(). The issue is,
send_packet() is not called when the node is simply relaying an UDP
SPTPS packet: indeed, send_sptps_data_priv() is called directly from
handle_incoming_vpn_data() in that case.

As a result, try_tx_sptps() is not called in the relaying case, which in
practice means that a relay doesn't initiate UDP/MTU discovery with the
next relay (unless some other activity compels it to do so). This can
result in packets getting sent over TCP instead of UDP from the relay.

src/net_packet.c

index df87e27f4409b4210643ceab563bc54c367dea92..8dba3258d989b1c159eb9307390f3ad5896c1ec8 100644 (file)
@@ -1396,6 +1396,7 @@ skip_harder:
 
                if(to != myself) {
                        send_sptps_data_priv(to, n, 0, DATA(&pkt), pkt.len - 2 * sizeof(node_id_t));
+                       try_tx_sptps(n, true);
                        return;
                }
        } else {