Skip to content

Commit

Permalink
New feature: Set advmss on IPv4 default route
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
toreanderson committed Oct 22, 2015
1 parent 9f1789f commit a80e2f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -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<ipv6_offlink_mtu> setting in I<conffile.c>.

=item B<v4-defaultroute-advmss=integer> (default: B<v4-defaultroute-mtu> - 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<v4-defaultroute-mtu> and substracting 40 (20 bytes for
the IPv4 header + 20 bytes for the TCP header). If B<v4-defaultroute-mtu> is
unset or 0, there is no default.

=back

=head1 LIMITATIONS
Expand Down
7 changes: 6 additions & 1 deletion clatd
Original file line number Diff line number Diff line change
Expand Up @@ -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


#
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a80e2f3

Please sign in to comment.