Insert the effective default advmss into %CFG

This ensures that the effective value (rather than the configured value or lack
thereof) is available in the environment of script-up/down.
This commit is contained in:
Tore Anderson 2015-10-23 11:33:35 +02:00
parent 0bc3bbd797
commit e8cb719f10
1 changed files with 5 additions and 3 deletions

8
clatd
View File

@ -734,6 +734,9 @@ p("Using CLAT IPv6 address: ", $CFG{"clat-v6-addr"});
if(!defined($CFG{"ip6tables-enable"})) { if(!defined($CFG{"ip6tables-enable"})) {
$CFG{"ip6tables-enable"} = -e "/sys/module/ip6table_filter" ? 1 : 0; $CFG{"ip6tables-enable"} = -e "/sys/module/ip6table_filter" ? 1 : 0;
} }
if(!$CFG{"v4-defaultroute-advmss"} and cfgint("v4-defaultroute-mtu")) {
$CFG{"v4-defaultroute-advmss"} = $CFG{"v4-defaultroute-mtu"} - 40;
}
# #
# Step 1: Detect if there is an IPv4 default route on the system from before. # Step 1: Detect if there is an IPv4 default route on the system from before.
@ -872,9 +875,8 @@ if(cfgbool("v4-defaultroute-enable")) {
} }
if(cfgint("v4-defaultroute-mtu")) { 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)); if(cfgint("v4-defaultroute-advmss")) {
} elsif(cfgint("v4-defaultroute-advmss")) {
push(@cmdline, ("advmss", cfgint("v4-defaultroute-advmss"))); push(@cmdline, ("advmss", cfgint("v4-defaultroute-advmss")));
} }
p("Adding IPv4 default route via the CLAT"); p("Adding IPv4 default route via the CLAT");