Disable PMTU discovery when TCPOnly is used.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 23 Oct 2017 19:10:20 +0000 (21:10 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 23 Oct 2017 19:12:39 +0000 (21:12 +0200)
src/net_setup.c
src/protocol_auth.c

index 314fd716fa412bb8361a6f3865c3ed085ae9d69c..49ea31b6893f5bdf09748513bf0e88b0d5892f91 100644 (file)
@@ -583,7 +583,7 @@ bool setup_myself_reloadable(void) {
                free(fmode);
        }
 
-       choice = true;
+       choice = !(myself->options & OPTION_TCPONLY);
        get_config_bool(lookup_config(config_tree, "PMTUDiscovery"), &choice);
 
        if(choice) {
index 68dd071712a4d5f1021fb98a0558036b2d028641..56ff3b1243ca5cc5e22aaafb8c9499b88e6ac740 100644 (file)
@@ -801,7 +801,7 @@ bool send_ack(connection_t *c) {
                c->options |= OPTION_TCPONLY | OPTION_INDIRECT;
        }
 
-       if(myself->options & OPTION_PMTU_DISCOVERY) {
+       if(myself->options & OPTION_PMTU_DISCOVERY && !(c->options & OPTION_TCPONLY)) {
                c->options |= OPTION_PMTU_DISCOVERY;
        }