From: David Sommerseth Date: Tue, 14 Feb 2012 10:45:27 +0000 (+0100) Subject: Connection entry {tun,link}_mtu_defined not set correctly X-Git-Tag: v2.3-alpha1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86e8754cd83d6c91a1ead344aea8c0ee131a9f26;p=thirdparty%2Fopenvpn.git Connection entry {tun,link}_mtu_defined not set correctly Commit 76809cae0eae07817160b423d3f9551df1a1d68e enabled setting MTU variables inside blocks. But in that process, the tun_mtu_defined and link_mtu_defined was not set as it should. By moving this out of the options_postprocess_mutate_invariant() function and into options_postprocess_mutate_ce(), these {tun,link}_mtu_defined variables are set correctly in each connection entry. Signed-off-by: David Sommerseth Acked-by: Gert Doering --- diff --git a/options.c b/options.c index 5e972b160..43e9e2710 100644 --- a/options.c +++ b/options.c @@ -2395,6 +2395,8 @@ options_postprocess_verify_ce (const struct options *options, const struct conne static void options_postprocess_mutate_ce (struct options *o, struct connection_entry *ce) { + const int dev = dev_type_enum (o->dev, o->dev_type); + #if P2MP_SERVER if (o->server_defined || o->server_bridge_defined || o->server_bridge_proxy_dhcp) { @@ -2441,6 +2443,21 @@ options_postprocess_mutate_ce (struct options *o, struct connection_entry *ce) #endif } + /* + * Set MTU defaults + */ + { + if (!ce->tun_mtu_defined && !ce->link_mtu_defined) + { + ce->tun_mtu_defined = true; + } + if ((dev == DEV_TYPE_TAP) && !ce->tun_mtu_extra_defined) + { + ce->tun_mtu_extra_defined = true; + ce->tun_mtu_extra = TAP_MTU_EXTRA_DEFAULT; + } + } + } static void @@ -2455,21 +2472,6 @@ options_postprocess_mutate_invariant (struct options *options) if (options->inetd == INETD_NOWAIT) options->ifconfig_noexec = true; - /* - * Set MTU defaults - */ - { - if (!options->ce.tun_mtu_defined && !options->ce.link_mtu_defined) - { - options->ce.tun_mtu_defined = true; - } - if ((dev == DEV_TYPE_TAP) && !options->ce.tun_mtu_extra_defined) - { - options->ce.tun_mtu_extra_defined = true; - options->ce.tun_mtu_extra = TAP_MTU_EXTRA_DEFAULT; - } - } - #ifdef WIN32 if ((dev == DEV_TYPE_TUN || dev == DEV_TYPE_TAP) && !options->route_delay_defined) {