Browse code

Connection entry {tun,link}_mtu_defined not set correctly

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>

David Sommerseth authored on 2012/02/14 19:45:27
Showing 1 changed files
... ...
@@ -2395,6 +2395,8 @@ options_postprocess_verify_ce (const struct options *options, const struct conne
2395 2395
 static void
2396 2396
 options_postprocess_mutate_ce (struct options *o, struct connection_entry *ce)
2397 2397
 {
2398
+  const int dev = dev_type_enum (o->dev, o->dev_type);
2399
+
2398 2400
 #if P2MP_SERVER
2399 2401
   if (o->server_defined || o->server_bridge_defined || o->server_bridge_proxy_dhcp)
2400 2402
     {
... ...
@@ -2441,6 +2443,21 @@ options_postprocess_mutate_ce (struct options *o, struct connection_entry *ce)
2441 2441
 #endif      
2442 2442
     }
2443 2443
 
2444
+  /*
2445
+   * Set MTU defaults
2446
+   */
2447
+  {
2448
+    if (!ce->tun_mtu_defined && !ce->link_mtu_defined)
2449
+      {
2450
+	ce->tun_mtu_defined = true;
2451
+      }
2452
+    if ((dev == DEV_TYPE_TAP) && !ce->tun_mtu_extra_defined)
2453
+      {
2454
+	ce->tun_mtu_extra_defined = true;
2455
+	ce->tun_mtu_extra = TAP_MTU_EXTRA_DEFAULT;
2456
+      }
2457
+  }
2458
+
2444 2459
 }
2445 2460
 
2446 2461
 static void
... ...
@@ -2455,21 +2472,6 @@ options_postprocess_mutate_invariant (struct options *options)
2455 2455
   if (options->inetd == INETD_NOWAIT)
2456 2456
     options->ifconfig_noexec = true;
2457 2457
 
2458
-  /*
2459
-   * Set MTU defaults
2460
-   */
2461
-  {
2462
-    if (!options->ce.tun_mtu_defined && !options->ce.link_mtu_defined)
2463
-      {
2464
-	options->ce.tun_mtu_defined = true;
2465
-      }
2466
-    if ((dev == DEV_TYPE_TAP) && !options->ce.tun_mtu_extra_defined)
2467
-      {
2468
-	options->ce.tun_mtu_extra_defined = true;
2469
-	options->ce.tun_mtu_extra = TAP_MTU_EXTRA_DEFAULT;
2470
-      }
2471
-  }
2472
-
2473 2458
 #ifdef WIN32
2474 2459
   if ((dev == DEV_TYPE_TUN || dev == DEV_TYPE_TAP) && !options->route_delay_defined)
2475 2460
     {