The following options may now be used in a connection block:
fragment
mssfix
tun-mtu
tun-mtu-extra
link-mtu
mtu_discover_type
explicit-exit-notification
In order to support stuff like
<connection>
remote host
proto udp
fragment
explicit-exit-notification 3
</connection>
<connection>
remote host
proto tcp
</connection>
Signed-off-by: Jan Just Keijser <janjust@nikhef.nl>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
| ... | ... |
@@ -1005,7 +1005,7 @@ process_incoming_tun (struct context *c) |
| 1005 | 1005 |
void |
| 1006 | 1006 |
process_ipv4_header (struct context *c, unsigned int flags, struct buffer *buf) |
| 1007 | 1007 |
{
|
| 1008 |
- if (!c->options.mssfix) |
|
| 1008 |
+ if (!c->options.ce.mssfix) |
|
| 1009 | 1009 |
flags &= ~PIPV4_MSSFIX; |
| 1010 | 1010 |
#if PASSTOS_CAPABILITY |
| 1011 | 1011 |
if (!c->options.passtos) |
| ... | ... |
@@ -1779,10 +1779,10 @@ do_deferred_options (struct context *c, const unsigned int found) |
| 1779 | 1779 |
#ifdef ENABLE_OCC |
| 1780 | 1780 |
if (found & OPT_P_EXPLICIT_NOTIFY) |
| 1781 | 1781 |
{
|
| 1782 |
- if (!proto_is_udp(c->options.ce.proto) && c->options.explicit_exit_notification) |
|
| 1782 |
+ if (!proto_is_udp(c->options.ce.proto) && c->options.ce.explicit_exit_notification) |
|
| 1783 | 1783 |
{
|
| 1784 | 1784 |
msg (D_PUSH, "OPTIONS IMPORT: --explicit-exit-notify can only be used with --proto udp"); |
| 1785 |
- c->options.explicit_exit_notification = 0; |
|
| 1785 |
+ c->options.ce.explicit_exit_notification = 0; |
|
| 1786 | 1786 |
} |
| 1787 | 1787 |
else |
| 1788 | 1788 |
msg (D_PUSH, "OPTIONS IMPORT: explicit notify parm(s) modified"); |
| ... | ... |
@@ -1955,10 +1955,10 @@ frame_finalize_options (struct context *c, const struct options *o) |
| 1955 | 1955 |
} |
| 1956 | 1956 |
|
| 1957 | 1957 |
frame_finalize (&c->c2.frame, |
| 1958 |
- o->link_mtu_defined, |
|
| 1959 |
- o->link_mtu, |
|
| 1960 |
- o->tun_mtu_defined, |
|
| 1961 |
- o->tun_mtu); |
|
| 1958 |
+ o->ce.link_mtu_defined, |
|
| 1959 |
+ o->ce.link_mtu, |
|
| 1960 |
+ o->ce.tun_mtu_defined, |
|
| 1961 |
+ o->ce.tun_mtu); |
|
| 1962 | 1962 |
} |
| 1963 | 1963 |
|
| 1964 | 1964 |
/* |
| ... | ... |
@@ -2404,8 +2404,8 @@ do_init_frame (struct context *c) |
| 2404 | 2404 |
/* |
| 2405 | 2405 |
* Adjust frame size based on the --tun-mtu-extra parameter. |
| 2406 | 2406 |
*/ |
| 2407 |
- if (c->options.tun_mtu_extra_defined) |
|
| 2408 |
- tun_adjust_frame_parameters (&c->c2.frame, c->options.tun_mtu_extra); |
|
| 2407 |
+ if (c->options.ce.tun_mtu_extra_defined) |
|
| 2408 |
+ tun_adjust_frame_parameters (&c->c2.frame, c->options.ce.tun_mtu_extra); |
|
| 2409 | 2409 |
|
| 2410 | 2410 |
/* |
| 2411 | 2411 |
* Adjust frame size based on link socket parameters. |
| ... | ... |
@@ -2434,13 +2434,13 @@ do_init_frame (struct context *c) |
| 2434 | 2434 |
/* |
| 2435 | 2435 |
* MTU advisories |
| 2436 | 2436 |
*/ |
| 2437 |
- if (c->options.fragment && c->options.mtu_test) |
|
| 2437 |
+ if (c->options.ce.fragment && c->options.mtu_test) |
|
| 2438 | 2438 |
msg (M_WARN, |
| 2439 | 2439 |
"WARNING: using --fragment and --mtu-test together may produce an inaccurate MTU test result"); |
| 2440 | 2440 |
#endif |
| 2441 | 2441 |
|
| 2442 | 2442 |
#ifdef ENABLE_FRAGMENT |
| 2443 |
- if ((c->options.mssfix || c->options.fragment) |
|
| 2443 |
+ if ((c->options.ce.mssfix || c->options.ce.fragment) |
|
| 2444 | 2444 |
&& TUN_MTU_SIZE (&c->c2.frame_fragment) != ETHERNET_MTU) |
| 2445 | 2445 |
msg (M_WARN, |
| 2446 | 2446 |
"WARNING: normally if you use --mssfix and/or --fragment, you should also set --tun-mtu %d (currently it is %d)", |
| ... | ... |
@@ -2612,9 +2612,9 @@ do_init_buffers (struct context *c) |
| 2612 | 2612 |
static void |
| 2613 | 2613 |
do_init_fragment (struct context *c) |
| 2614 | 2614 |
{
|
| 2615 |
- ASSERT (c->options.fragment); |
|
| 2615 |
+ ASSERT (c->options.ce.fragment); |
|
| 2616 | 2616 |
frame_set_mtu_dynamic (&c->c2.frame_fragment, |
| 2617 |
- c->options.fragment, SET_MTU_UPPER_BOUND); |
|
| 2617 |
+ c->options.ce.fragment, SET_MTU_UPPER_BOUND); |
|
| 2618 | 2618 |
fragment_frame_init (c->c2.fragment, &c->c2.frame_fragment); |
| 2619 | 2619 |
} |
| 2620 | 2620 |
#endif |
| ... | ... |
@@ -2625,10 +2625,10 @@ do_init_fragment (struct context *c) |
| 2625 | 2625 |
static void |
| 2626 | 2626 |
do_init_mssfix (struct context *c) |
| 2627 | 2627 |
{
|
| 2628 |
- if (c->options.mssfix) |
|
| 2628 |
+ if (c->options.ce.mssfix) |
|
| 2629 | 2629 |
{
|
| 2630 | 2630 |
frame_set_mtu_dynamic (&c->c2.frame, |
| 2631 |
- c->options.mssfix, SET_MTU_UPPER_BOUND); |
|
| 2631 |
+ c->options.ce.mssfix, SET_MTU_UPPER_BOUND); |
|
| 2632 | 2632 |
} |
| 2633 | 2633 |
} |
| 2634 | 2634 |
|
| ... | ... |
@@ -2684,7 +2684,7 @@ do_init_socket_1 (struct context *c, const int mode) |
| 2684 | 2684 |
c->options.ce.connect_retry_seconds, |
| 2685 | 2685 |
c->options.ce.connect_timeout, |
| 2686 | 2686 |
c->options.ce.connect_retry_max, |
| 2687 |
- c->options.mtu_discover_type, |
|
| 2687 |
+ c->options.ce.mtu_discover_type, |
|
| 2688 | 2688 |
c->options.rcvbuf, |
| 2689 | 2689 |
c->options.sndbuf, |
| 2690 | 2690 |
c->options.mark, |
| ... | ... |
@@ -3399,7 +3399,7 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int |
| 3399 | 3399 |
|
| 3400 | 3400 |
#ifdef ENABLE_FRAGMENT |
| 3401 | 3401 |
/* initialize internal fragmentation object */ |
| 3402 |
- if (options->fragment && (c->mode == CM_P2P || child)) |
|
| 3402 |
+ if (options->ce.fragment && (c->mode == CM_P2P || child)) |
|
| 3403 | 3403 |
c->c2.fragment = fragment_init (&c->c2.frame); |
| 3404 | 3404 |
#endif |
| 3405 | 3405 |
|
| ... | ... |
@@ -3435,7 +3435,7 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int |
| 3435 | 3435 |
|
| 3436 | 3436 |
#ifdef ENABLE_FRAGMENT |
| 3437 | 3437 |
/* initialize internal fragmentation capability with known frame size */ |
| 3438 |
- if (options->fragment && (c->mode == CM_P2P || child)) |
|
| 3438 |
+ if (options->ce.fragment && (c->mode == CM_P2P || child)) |
|
| 3439 | 3439 |
do_init_fragment (c); |
| 3440 | 3440 |
#endif |
| 3441 | 3441 |
|
| ... | ... |
@@ -368,7 +368,7 @@ process_received_occ_msg (struct context *c) |
| 368 | 368 |
c->c2.max_recv_size_remote, |
| 369 | 369 |
c->c2.max_send_size_remote, |
| 370 | 370 |
c->c2.max_recv_size_local); |
| 371 |
- if (!c->options.fragment |
|
| 371 |
+ if (!c->options.ce.fragment |
|
| 372 | 372 |
&& (proto_is_dgram(c->options.ce.proto)) |
| 373 | 373 |
&& c->c2.max_send_size_local > TUN_MTU_MIN |
| 374 | 374 |
&& (c->c2.max_recv_size_remote < c->c2.max_send_size_local |
| ... | ... |
@@ -767,10 +767,10 @@ init_options (struct options *o, const bool init_gc) |
| 767 | 767 |
o->status_file_update_freq = 60; |
| 768 | 768 |
o->status_file_version = 1; |
| 769 | 769 |
o->ce.bind_local = true; |
| 770 |
- o->tun_mtu = TUN_MTU_DEFAULT; |
|
| 771 |
- o->link_mtu = LINK_MTU_DEFAULT; |
|
| 772 |
- o->mtu_discover_type = -1; |
|
| 773 |
- o->mssfix = MSSFIX_DEFAULT; |
|
| 770 |
+ o->ce.tun_mtu = TUN_MTU_DEFAULT; |
|
| 771 |
+ o->ce.link_mtu = LINK_MTU_DEFAULT; |
|
| 772 |
+ o->ce.mtu_discover_type = -1; |
|
| 773 |
+ o->ce.mssfix = MSSFIX_DEFAULT; |
|
| 774 | 774 |
o->route_delay_window = 30; |
| 775 | 775 |
o->max_routes = MAX_ROUTES_DEFAULT; |
| 776 | 776 |
o->resolve_retry_seconds = RESOLV_RETRY_INFINITE; |
| ... | ... |
@@ -1360,8 +1360,26 @@ show_connection_entry (const struct connection_entry *o) |
| 1360 | 1360 |
SHOW_INT (socks_proxy_port); |
| 1361 | 1361 |
SHOW_BOOL (socks_proxy_retry); |
| 1362 | 1362 |
#endif |
| 1363 |
+ SHOW_INT (tun_mtu); |
|
| 1364 |
+ SHOW_BOOL (tun_mtu_defined); |
|
| 1365 |
+ SHOW_INT (link_mtu); |
|
| 1366 |
+ SHOW_BOOL (link_mtu_defined); |
|
| 1367 |
+ SHOW_INT (tun_mtu_extra); |
|
| 1368 |
+ SHOW_BOOL (tun_mtu_extra_defined); |
|
| 1369 |
+ |
|
| 1370 |
+ SHOW_INT (mtu_discover_type); |
|
| 1371 |
+ |
|
| 1372 |
+#ifdef ENABLE_FRAGMENT |
|
| 1373 |
+ SHOW_INT (fragment); |
|
| 1374 |
+#endif |
|
| 1375 |
+ SHOW_INT (mssfix); |
|
| 1376 |
+ |
|
| 1377 |
+#ifdef ENABLE_OCC |
|
| 1378 |
+ SHOW_INT (explicit_exit_notification); |
|
| 1379 |
+#endif |
|
| 1363 | 1380 |
} |
| 1364 | 1381 |
|
| 1382 |
+ |
|
| 1365 | 1383 |
static void |
| 1366 | 1384 |
show_connection_entries (const struct options *o) |
| 1367 | 1385 |
{
|
| ... | ... |
@@ -1432,19 +1450,6 @@ show_settings (const struct options *o) |
| 1432 | 1432 |
#ifdef HAVE_GETTIMEOFDAY |
| 1433 | 1433 |
SHOW_INT (shaper); |
| 1434 | 1434 |
#endif |
| 1435 |
- SHOW_INT (tun_mtu); |
|
| 1436 |
- SHOW_BOOL (tun_mtu_defined); |
|
| 1437 |
- SHOW_INT (link_mtu); |
|
| 1438 |
- SHOW_BOOL (link_mtu_defined); |
|
| 1439 |
- SHOW_INT (tun_mtu_extra); |
|
| 1440 |
- SHOW_BOOL (tun_mtu_extra_defined); |
|
| 1441 |
- |
|
| 1442 |
-#ifdef ENABLE_FRAGMENT |
|
| 1443 |
- SHOW_INT (fragment); |
|
| 1444 |
-#endif |
|
| 1445 |
- |
|
| 1446 |
- SHOW_INT (mtu_discover_type); |
|
| 1447 |
- |
|
| 1448 | 1435 |
#ifdef ENABLE_OCC |
| 1449 | 1436 |
SHOW_INT (mtu_test); |
| 1450 | 1437 |
#endif |
| ... | ... |
@@ -1459,16 +1464,11 @@ show_settings (const struct options *o) |
| 1459 | 1459 |
SHOW_INT (ping_rec_timeout_action); |
| 1460 | 1460 |
SHOW_BOOL (ping_timer_remote); |
| 1461 | 1461 |
SHOW_INT (remap_sigusr1); |
| 1462 |
-#ifdef ENABLE_OCC |
|
| 1463 |
- SHOW_INT (explicit_exit_notification); |
|
| 1464 |
-#endif |
|
| 1465 | 1462 |
SHOW_BOOL (persist_tun); |
| 1466 | 1463 |
SHOW_BOOL (persist_local_ip); |
| 1467 | 1464 |
SHOW_BOOL (persist_remote_ip); |
| 1468 | 1465 |
SHOW_BOOL (persist_key); |
| 1469 | 1466 |
|
| 1470 |
- SHOW_INT (mssfix); |
|
| 1471 |
- |
|
| 1472 | 1467 |
#if PASSTOS_CAPABILITY |
| 1473 | 1468 |
SHOW_BOOL (passtos); |
| 1474 | 1469 |
#endif |
| ... | ... |
@@ -1958,7 +1958,7 @@ options_postprocess_verify_ce (const struct options *options, const struct conne |
| 1958 | 1958 |
/* |
| 1959 | 1959 |
* Sanity check on MTU parameters |
| 1960 | 1960 |
*/ |
| 1961 |
- if (options->tun_mtu_defined && options->link_mtu_defined) |
|
| 1961 |
+ if (options->ce.tun_mtu_defined && options->ce.link_mtu_defined) |
|
| 1962 | 1962 |
msg (M_USAGE, "only one of --tun-mtu or --link-mtu may be defined (note that --ifconfig implies --link-mtu %d)", LINK_MTU_DEFAULT); |
| 1963 | 1963 |
|
| 1964 | 1964 |
#ifdef ENABLE_OCC |
| ... | ... |
@@ -2041,12 +2041,12 @@ options_postprocess_verify_ce (const struct options *options, const struct conne |
| 2041 | 2041 |
*/ |
| 2042 | 2042 |
|
| 2043 | 2043 |
#ifdef ENABLE_FRAGMENT |
| 2044 |
- if (!proto_is_udp(ce->proto) && options->fragment) |
|
| 2044 |
+ if (!proto_is_udp(ce->proto) && ce->fragment) |
|
| 2045 | 2045 |
msg (M_USAGE, "--fragment can only be used with --proto udp"); |
| 2046 | 2046 |
#endif |
| 2047 | 2047 |
|
| 2048 | 2048 |
#ifdef ENABLE_OCC |
| 2049 |
- if (!proto_is_udp(ce->proto) && options->explicit_exit_notification) |
|
| 2049 |
+ if (!proto_is_udp(ce->proto) && ce->explicit_exit_notification) |
|
| 2050 | 2050 |
msg (M_USAGE, "--explicit-exit-notify can only be used with --proto udp"); |
| 2051 | 2051 |
#endif |
| 2052 | 2052 |
|
| ... | ... |
@@ -2131,7 +2131,7 @@ options_postprocess_verify_ce (const struct options *options, const struct conne |
| 2131 | 2131 |
if (!(dev == DEV_TYPE_TAP || (dev == DEV_TYPE_TUN && options->topology == TOP_SUBNET)) && options->ifconfig_pool_netmask) |
| 2132 | 2132 |
msg (M_USAGE, "The third parameter to --ifconfig-pool (netmask) is only valid in --dev tap mode"); |
| 2133 | 2133 |
#ifdef ENABLE_OCC |
| 2134 |
- if (options->explicit_exit_notification) |
|
| 2134 |
+ if (ce->explicit_exit_notification) |
|
| 2135 | 2135 |
msg (M_USAGE, "--explicit-exit-notify cannot be used with --mode server"); |
| 2136 | 2136 |
#endif |
| 2137 | 2137 |
if (options->routes && (options->routes->flags & RG_ENABLE)) |
| ... | ... |
@@ -2426,27 +2426,28 @@ options_postprocess_mutate_ce (struct options *o, struct connection_entry *ce) |
| 2426 | 2426 |
/* if protocol forcing is enabled, disable all protocols except for the forced one */ |
| 2427 | 2427 |
if (o->proto_force >= 0 && proto_is_tcp(o->proto_force) != proto_is_tcp(ce->proto)) |
| 2428 | 2428 |
ce->flags |= CE_DISABLED; |
| 2429 |
-} |
|
| 2430 |
- |
|
| 2431 |
-static void |
|
| 2432 |
-options_postprocess_mutate_invariant (struct options *options) |
|
| 2433 |
-{
|
|
| 2434 |
- const int dev = dev_type_enum (options->dev, options->dev_type); |
|
| 2435 | 2429 |
|
| 2436 | 2430 |
/* |
| 2437 | 2431 |
* If --mssfix is supplied without a parameter, default |
| 2438 | 2432 |
* it to --fragment value, if --fragment is specified. |
| 2439 | 2433 |
*/ |
| 2440 |
- if (options->mssfix_default) |
|
| 2434 |
+ if (o->ce.mssfix_default) |
|
| 2441 | 2435 |
{
|
| 2442 | 2436 |
#ifdef ENABLE_FRAGMENT |
| 2443 |
- if (options->fragment) |
|
| 2444 |
- options->mssfix = options->fragment; |
|
| 2437 |
+ if (ce->fragment) |
|
| 2438 |
+ o->ce.mssfix = ce->fragment; |
|
| 2445 | 2439 |
#else |
| 2446 | 2440 |
msg (M_USAGE, "--mssfix must specify a parameter"); |
| 2447 | 2441 |
#endif |
| 2448 | 2442 |
} |
| 2449 | 2443 |
|
| 2444 |
+} |
|
| 2445 |
+ |
|
| 2446 |
+static void |
|
| 2447 |
+options_postprocess_mutate_invariant (struct options *options) |
|
| 2448 |
+{
|
|
| 2449 |
+ const int dev = dev_type_enum (options->dev, options->dev_type); |
|
| 2450 |
+ |
|
| 2450 | 2451 |
/* |
| 2451 | 2452 |
* In forking TCP server mode, you don't need to ifconfig |
| 2452 | 2453 |
* the tap device (the assumption is that it will be bridged). |
| ... | ... |
@@ -2458,14 +2459,14 @@ options_postprocess_mutate_invariant (struct options *options) |
| 2458 | 2458 |
* Set MTU defaults |
| 2459 | 2459 |
*/ |
| 2460 | 2460 |
{
|
| 2461 |
- if (!options->tun_mtu_defined && !options->link_mtu_defined) |
|
| 2461 |
+ if (!options->ce.tun_mtu_defined && !options->ce.link_mtu_defined) |
|
| 2462 | 2462 |
{
|
| 2463 |
- options->tun_mtu_defined = true; |
|
| 2463 |
+ options->ce.tun_mtu_defined = true; |
|
| 2464 | 2464 |
} |
| 2465 |
- if ((dev == DEV_TYPE_TAP) && !options->tun_mtu_extra_defined) |
|
| 2465 |
+ if ((dev == DEV_TYPE_TAP) && !options->ce.tun_mtu_extra_defined) |
|
| 2466 | 2466 |
{
|
| 2467 |
- options->tun_mtu_extra_defined = true; |
|
| 2468 |
- options->tun_mtu_extra = TAP_MTU_EXTRA_DEFAULT; |
|
| 2467 |
+ options->ce.tun_mtu_extra_defined = true; |
|
| 2468 |
+ options->ce.tun_mtu_extra = TAP_MTU_EXTRA_DEFAULT; |
|
| 2469 | 2469 |
} |
| 2470 | 2470 |
} |
| 2471 | 2471 |
|
| ... | ... |
@@ -2951,7 +2952,7 @@ options_string (const struct options *o, |
| 2951 | 2951 |
#endif |
| 2952 | 2952 |
|
| 2953 | 2953 |
#ifdef ENABLE_FRAGMENT |
| 2954 |
- if (o->fragment) |
|
| 2954 |
+ if (o->ce.fragment) |
|
| 2955 | 2955 |
buf_printf (&out, ",mtu-dynamic"); |
| 2956 | 2956 |
#endif |
| 2957 | 2957 |
|
| ... | ... |
@@ -4729,39 +4730,40 @@ add_option (struct options *options, |
| 4729 | 4729 |
} |
| 4730 | 4730 |
else if ((streq (p[0], "link-mtu") || streq (p[0], "udp-mtu")) && p[1]) |
| 4731 | 4731 |
{
|
| 4732 |
- VERIFY_PERMISSION (OPT_P_MTU); |
|
| 4733 |
- options->link_mtu = positive_atoi (p[1]); |
|
| 4734 |
- options->link_mtu_defined = true; |
|
| 4732 |
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION); |
|
| 4733 |
+ options->ce.link_mtu = positive_atoi (p[1]); |
|
| 4734 |
+ options->ce.link_mtu_defined = true; |
|
| 4735 | 4735 |
} |
| 4736 | 4736 |
else if (streq (p[0], "tun-mtu") && p[1]) |
| 4737 | 4737 |
{
|
| 4738 |
- VERIFY_PERMISSION (OPT_P_MTU); |
|
| 4739 |
- options->tun_mtu = positive_atoi (p[1]); |
|
| 4740 |
- options->tun_mtu_defined = true; |
|
| 4738 |
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION); |
|
| 4739 |
+ options->ce.tun_mtu = positive_atoi (p[1]); |
|
| 4740 |
+ options->ce.tun_mtu_defined = true; |
|
| 4741 | 4741 |
} |
| 4742 | 4742 |
else if (streq (p[0], "tun-mtu-extra") && p[1]) |
| 4743 | 4743 |
{
|
| 4744 |
- VERIFY_PERMISSION (OPT_P_MTU); |
|
| 4745 |
- options->tun_mtu_extra = positive_atoi (p[1]); |
|
| 4746 |
- options->tun_mtu_extra_defined = true; |
|
| 4744 |
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION); |
|
| 4745 |
+ options->ce.tun_mtu_extra = positive_atoi (p[1]); |
|
| 4746 |
+ options->ce.tun_mtu_extra_defined = true; |
|
| 4747 | 4747 |
} |
| 4748 | 4748 |
#ifdef ENABLE_FRAGMENT |
| 4749 | 4749 |
else if (streq (p[0], "mtu-dynamic")) |
| 4750 | 4750 |
{
|
| 4751 |
- VERIFY_PERMISSION (OPT_P_GENERAL); |
|
| 4751 |
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION); |
|
| 4752 | 4752 |
msg (msglevel, "--mtu-dynamic has been replaced by --fragment"); |
| 4753 | 4753 |
goto err; |
| 4754 | 4754 |
} |
| 4755 | 4755 |
else if (streq (p[0], "fragment") && p[1]) |
| 4756 | 4756 |
{
|
| 4757 |
- VERIFY_PERMISSION (OPT_P_MTU); |
|
| 4758 |
- options->fragment = positive_atoi (p[1]); |
|
| 4757 |
+// VERIFY_PERMISSION (OPT_P_MTU); |
|
| 4758 |
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION); |
|
| 4759 |
+ options->ce.fragment = positive_atoi (p[1]); |
|
| 4759 | 4760 |
} |
| 4760 | 4761 |
#endif |
| 4761 | 4762 |
else if (streq (p[0], "mtu-disc") && p[1]) |
| 4762 | 4763 |
{
|
| 4763 |
- VERIFY_PERMISSION (OPT_P_MTU); |
|
| 4764 |
- options->mtu_discover_type = translate_mtu_discover_type_name (p[1]); |
|
| 4764 |
+ VERIFY_PERMISSION (OPT_P_MTU|OPT_P_CONNECTION); |
|
| 4765 |
+ options->ce.mtu_discover_type = translate_mtu_discover_type_name (p[1]); |
|
| 4765 | 4766 |
} |
| 4766 | 4767 |
#ifdef ENABLE_OCC |
| 4767 | 4768 |
else if (streq (p[0], "mtu-test")) |
| ... | ... |
@@ -5106,14 +5108,15 @@ add_option (struct options *options, |
| 5106 | 5106 |
#ifdef ENABLE_OCC |
| 5107 | 5107 |
else if (streq (p[0], "explicit-exit-notify")) |
| 5108 | 5108 |
{
|
| 5109 |
- VERIFY_PERMISSION (OPT_P_EXPLICIT_NOTIFY); |
|
| 5109 |
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION); |
|
| 5110 |
+// VERIFY_PERMISSION (OPT_P_EXPLICIT_NOTIFY); |
|
| 5110 | 5111 |
if (p[1]) |
| 5111 | 5112 |
{
|
| 5112 |
- options->explicit_exit_notification = positive_atoi (p[1]); |
|
| 5113 |
+ options->ce.explicit_exit_notification = positive_atoi (p[1]); |
|
| 5113 | 5114 |
} |
| 5114 | 5115 |
else |
| 5115 | 5116 |
{
|
| 5116 |
- options->explicit_exit_notification = 1; |
|
| 5117 |
+ options->ce.explicit_exit_notification = 1; |
|
| 5117 | 5118 |
} |
| 5118 | 5119 |
} |
| 5119 | 5120 |
#endif |
| ... | ... |
@@ -5369,13 +5372,13 @@ add_option (struct options *options, |
| 5369 | 5369 |
} |
| 5370 | 5370 |
else if (streq (p[0], "mssfix")) |
| 5371 | 5371 |
{
|
| 5372 |
- VERIFY_PERMISSION (OPT_P_GENERAL); |
|
| 5372 |
+ VERIFY_PERMISSION (OPT_P_GENERAL|OPT_P_CONNECTION); |
|
| 5373 | 5373 |
if (p[1]) |
| 5374 | 5374 |
{
|
| 5375 |
- options->mssfix = positive_atoi (p[1]); |
|
| 5375 |
+ options->ce.mssfix = positive_atoi (p[1]); |
|
| 5376 | 5376 |
} |
| 5377 | 5377 |
else |
| 5378 |
- options->mssfix_default = true; |
|
| 5378 |
+ options->ce.mssfix_default = true; |
|
| 5379 | 5379 |
|
| 5380 | 5380 |
} |
| 5381 | 5381 |
#ifdef ENABLE_OCC |
| ... | ... |
@@ -111,6 +111,24 @@ struct connection_entry |
| 111 | 111 |
bool socks_proxy_retry; |
| 112 | 112 |
#endif |
| 113 | 113 |
|
| 114 |
+ int tun_mtu; /* MTU of tun device */ |
|
| 115 |
+ bool tun_mtu_defined; /* true if user overriding parm with command line option */ |
|
| 116 |
+ int tun_mtu_extra; |
|
| 117 |
+ bool tun_mtu_extra_defined; |
|
| 118 |
+ int link_mtu; /* MTU of device over which tunnel packets pass via TCP/UDP */ |
|
| 119 |
+ bool link_mtu_defined; /* true if user overriding parm with command line option */ |
|
| 120 |
+ |
|
| 121 |
+ /* Advanced MTU negotiation and datagram fragmentation options */ |
|
| 122 |
+ int mtu_discover_type; /* used if OS supports setting Path MTU discovery options on socket */ |
|
| 123 |
+ |
|
| 124 |
+ int fragment; /* internal fragmentation size */ |
|
| 125 |
+ int mssfix; /* Upper bound on TCP MSS */ |
|
| 126 |
+ bool mssfix_default; /* true if --mssfix was supplied without a parameter */ |
|
| 127 |
+ |
|
| 128 |
+#ifdef ENABLE_OCC |
|
| 129 |
+ int explicit_exit_notification; /* Explicitly tell peer when we are exiting via OCC_EXIT message */ |
|
| 130 |
+#endif |
|
| 131 |
+ |
|
| 114 | 132 |
# define CE_DISABLED (1<<0) |
| 115 | 133 |
#if HTTP_PROXY_FALLBACK |
| 116 | 134 |
# define CE_HTTP_PROXY_FALLBACK (1<<1) |
| ... | ... |
@@ -245,24 +263,13 @@ struct options |
| 245 | 245 |
#ifdef HAVE_GETTIMEOFDAY |
| 246 | 246 |
int shaper; |
| 247 | 247 |
#endif |
| 248 |
- int tun_mtu; /* MTU of tun device */ |
|
| 249 |
- int tun_mtu_extra; |
|
| 250 |
- bool tun_mtu_extra_defined; |
|
| 251 |
- int link_mtu; /* MTU of device over which tunnel packets pass via TCP/UDP */ |
|
| 252 |
- bool tun_mtu_defined; /* true if user overriding parm with command line option */ |
|
| 253 |
- bool link_mtu_defined; /* true if user overriding parm with command line option */ |
|
| 254 | 248 |
|
| 255 | 249 |
int proto_force; |
| 256 | 250 |
|
| 257 |
- /* Advanced MTU negotiation and datagram fragmentation options */ |
|
| 258 |
- int mtu_discover_type; /* used if OS supports setting Path MTU discovery options on socket */ |
|
| 259 |
- |
|
| 260 | 251 |
#ifdef ENABLE_OCC |
| 261 | 252 |
bool mtu_test; |
| 262 | 253 |
#endif |
| 263 | 254 |
|
| 264 |
- int fragment; /* internal fragmentation size */ |
|
| 265 |
- |
|
| 266 | 255 |
#ifdef ENABLE_MEMSTATS |
| 267 | 256 |
char *memstats_fn; |
| 268 | 257 |
#endif |
| ... | ... |
@@ -285,18 +292,11 @@ struct options |
| 285 | 285 |
# define PING_RESTART 2 |
| 286 | 286 |
int ping_rec_timeout_action; /* What action to take on ping_rec_timeout (exit or restart)? */ |
| 287 | 287 |
|
| 288 |
-#ifdef ENABLE_OCC |
|
| 289 |
- int explicit_exit_notification; /* Explicitly tell peer when we are exiting via OCC_EXIT message */ |
|
| 290 |
-#endif |
|
| 291 |
- |
|
| 292 | 288 |
bool persist_tun; /* Don't close/reopen TUN/TAP dev on SIGUSR1 or PING_RESTART */ |
| 293 | 289 |
bool persist_local_ip; /* Don't re-resolve local address on SIGUSR1 or PING_RESTART */ |
| 294 | 290 |
bool persist_remote_ip; /* Don't re-resolve remote address on SIGUSR1 or PING_RESTART */ |
| 295 | 291 |
bool persist_key; /* Don't re-read key files on SIGUSR1 or PING_RESTART */ |
| 296 | 292 |
|
| 297 |
- int mssfix; /* Upper bound on TCP MSS */ |
|
| 298 |
- bool mssfix_default; /* true if --mssfix was supplied without a parameter */ |
|
| 299 |
- |
|
| 300 | 293 |
#if PASSTOS_CAPABILITY |
| 301 | 294 |
bool passtos; |
| 302 | 295 |
#endif |
| ... | ... |
@@ -300,8 +300,8 @@ process_explicit_exit_notification_timer_wakeup (struct context *c) |
| 300 | 300 |
&c->c2.timeval, |
| 301 | 301 |
ETT_DEFAULT)) |
| 302 | 302 |
{
|
| 303 |
- ASSERT (c->c2.explicit_exit_notification_time_wait && c->options.explicit_exit_notification); |
|
| 304 |
- if (now >= c->c2.explicit_exit_notification_time_wait + c->options.explicit_exit_notification) |
|
| 303 |
+ ASSERT (c->c2.explicit_exit_notification_time_wait && c->options.ce.explicit_exit_notification); |
|
| 304 |
+ if (now >= c->c2.explicit_exit_notification_time_wait + c->options.ce.explicit_exit_notification) |
|
| 305 | 305 |
{
|
| 306 | 306 |
event_timeout_clear (&c->c2.explicit_exit_notification_interval); |
| 307 | 307 |
c->sig->signal_received = SIGTERM; |
| ... | ... |
@@ -340,7 +340,7 @@ process_sigterm (struct context *c) |
| 340 | 340 |
{
|
| 341 | 341 |
bool ret = true; |
| 342 | 342 |
#ifdef ENABLE_OCC |
| 343 |
- if (c->options.explicit_exit_notification |
|
| 343 |
+ if (c->options.ce.explicit_exit_notification |
|
| 344 | 344 |
&& !c->c2.explicit_exit_notification_time_wait) |
| 345 | 345 |
{
|
| 346 | 346 |
process_explicit_exit_notification_init (c); |