]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Connection entry {tun,link}_mtu_defined not set correctly
authorDavid Sommerseth <davids@redhat.com>
Tue, 14 Feb 2012 10:45:27 +0000 (11:45 +0100)
committerDavid Sommerseth <davids@redhat.com>
Tue, 14 Feb 2012 19:16:50 +0000 (20:16 +0100)
Commit 76809cae0eae07817160b423d3f9551df1a1d68e enabled setting MTU
variables inside <connection> 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 <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
options.c

index 5e972b16034cdb1ad4d9a5e9136b747411855951..43e9e2710f358be2f92b778920e2858a3fcb4072 100644 (file)
--- 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)
     {