From e8cb719f10263753a96d7d15ed1a61a5c069199b Mon Sep 17 00:00:00 2001 From: Tore Anderson Date: Fri, 23 Oct 2015 11:33:35 +0200 Subject: [PATCH] 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. --- clatd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clatd b/clatd index 36eb1d1..2cb0c7f 100755 --- a/clatd +++ b/clatd @@ -734,6 +734,9 @@ p("Using CLAT IPv6 address: ", $CFG{"clat-v6-addr"}); if(!defined($CFG{"ip6tables-enable"})) { $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. @@ -872,9 +875,8 @@ if(cfgbool("v4-defaultroute-enable")) { } if(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")) { + } + if(cfgint("v4-defaultroute-advmss")) { push(@cmdline, ("advmss", cfgint("v4-defaultroute-advmss"))); } p("Adding IPv4 default route via the CLAT");