From a80e2f30abe8bb4b8d0e5ce1eca99ee4fc02b6f7 Mon Sep 17 00:00:00 2001 From: Tore Anderson Date: Thu, 22 Oct 2015 11:58:19 +0200 Subject: [PATCH] New feature: Set advmss on IPv4 default route This ensures that TCP connections terminated through the CLAT gets a sensible TCP MSS value negotiated. By default, the value is set to the MTU of the defaultroute minus 40. There should be no reason to change this in the vast majority of cases, but it can be overridden with the "v4-defaultroute-advmss" setting. --- README.pod | 11 +++++++++++ clatd | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.pod b/README.pod index 331a4c7..82185e4 100644 --- a/README.pod +++ b/README.pod @@ -326,6 +326,17 @@ If you know that the IPv6 Path MTU between the host and the PLAT is larger than 1280, you may increase this, but then you should also recompile TAYGA with a larger B setting in I. +=item B (default: B - 40) + +The "advmss" value assigned to the the default route potining to the CLAT. This +controls the advertised TCP MSS value for TCP connections made through the +CLAT. + +You should normally not need to set this. By default the value is calculated by +taking the value of B and substracting 40 (20 bytes for +the IPv4 header + 20 bytes for the TCP header). If B is +unset or 0, there is no default. + =back =head1 LIMITATIONS diff --git a/clatd b/clatd index f48a9ca..3ef5ff2 100755 --- a/clatd +++ b/clatd @@ -40,6 +40,7 @@ $CFG{"v4-defaultroute-enable"} = 1; # add a v4 defaultroute via the CLAT? $CFG{"v4-defaultroute-replace"} = 0; # replace existing v4 defaultroute? $CFG{"v4-defaultroute-metric"} = 2048; # metric for the IPv4 defaultroute $CFG{"v4-defaultroute-mtu"} = 1260; # MTU for the IPv4 defaultroute +$CFG{"v4-defaultroute-advmss"} = 0; # TCP MSS for the IPv4 defaultroute # @@ -868,7 +869,11 @@ if(cfgbool("v4-defaultroute-enable")) { push(@cmdline, ("metric", cfgint("v4-defaultroute-metric"))) } if(cfgint("v4-defaultroute-mtu")) { - push(@cmdline, ("mtu", cfgint("v4-defaultroute-mtu"))) + push(@cmdline, ("mtu", cfgint("v4-defaultroute-mtu"))); + push(@cmdline, ("advmss", cfgint("v4-defaultroute-advmss") || + cfgint("v4-defaultroute-mtu") - 40)); + } elsif(cfgint("v4-defaultroute-advmss")) { + push(@cmdline, ("advmss", cfgint("v4-defaultroute-advmss"))); } p("Adding IPv4 default route via the CLAT"); cmd(\&err, cfg("cmd-ip"), @cmdline);