Skip to content

Commit 5c4744f

Browse files
flichtenheldcron2
authored andcommitted
Clean up documentation for --tun-mtu-max
There was some confusion about how the option was called... Change-Id: I5e240c35cd4236e1d845195e4634fd5008f61814 Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Gert Doering <[email protected]> Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg32663.html Signed-off-by: Gert Doering <[email protected]>
1 parent 4f7ae8a commit 5c4744f

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

doc/man-sections/vpn-network-options.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ routing.
587587
packets larger than ``tun-mtu`` (e.g. Linux and FreeBSD) but other platforms
588588
(like macOS) limit received packets to the same size as the MTU.
589589

590-
--tun-max-mtu maxmtu
590+
--tun-mtu-max maxmtu
591591
This configures the maximum MTU size that a server can push to ``maxmtu``,
592592
by configuring the internal buffers to allow at least this packet size.
593593
The default for ``maxmtu`` is 1600. Currently, only increasing beyond 1600

src/openvpn/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2916,7 +2916,7 @@ frame_finalize_options(struct context *c, const struct options *o)
29162916

29172917
/* We always allow at least 1600 MTU packets to be received in our buffer
29182918
* space to allow server to push "baby giant" MTU sizes */
2919-
frame->tun_max_mtu = max_int(1600, frame->tun_max_mtu);
2919+
frame->tun_max_mtu = max_int(TUN_MTU_MAX_MIN, frame->tun_max_mtu);
29202920

29212921
size_t payload_size = frame->tun_max_mtu;
29222922

src/openvpn/mtu.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868
*/
6969
#define TUN_MTU_DEFAULT 1500
7070

71+
/*
72+
* Minimum maximum MTU
73+
*/
74+
#define TUN_MTU_MAX_MIN 1600
75+
7176
/*
7277
* MTU Defaults for TAP devices
7378
*/

src/openvpn/options.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ static const char usage_message[] =
297297
"--tun-mtu-extra n : Assume that tun/tap device might return as many\n"
298298
" as n bytes more than the tun-mtu size on read\n"
299299
" (default TUN=0 TAP=%d).\n"
300+
"--tun-mtu-max n : Maximum pushable MTU (default and minimum=%d).\n"
300301
"--link-mtu n : Take the TCP/UDP device MTU to be n and derive the tun MTU\n"
301302
" from it.\n"
302303
"--mtu-disc type : Should we do Path MTU discovery on TCP/UDP channel?\n"
@@ -4844,8 +4845,9 @@ usage(void)
48444845

48454846
fprintf(fp, usage_message, title_string, o.ce.connect_retry_seconds,
48464847
o.ce.connect_retry_seconds_max, o.ce.local_port, o.ce.remote_port, TUN_MTU_DEFAULT,
4847-
TAP_MTU_EXTRA_DEFAULT, o.verbosity, o.authname, o.replay_window, o.replay_time,
4848-
o.tls_timeout, o.renegotiate_seconds, o.handshake_window, o.transition_window);
4848+
TAP_MTU_EXTRA_DEFAULT, TUN_MTU_MAX_MIN, o.verbosity, o.authname, o.replay_window,
4849+
o.replay_time, o.tls_timeout, o.renegotiate_seconds, o.handshake_window,
4850+
o.transition_window);
48494851
fflush(fp);
48504852

48514853
#endif /* ENABLE_SMALL */
@@ -7011,7 +7013,7 @@ add_option(struct options *options, char *p[], bool is_inline, const char *file,
70117013
options->ce.occ_mtu = 0;
70127014
}
70137015
}
7014-
else if (streq(p[0], "tun-mtu-max") && p[1] && !p[3])
7016+
else if (streq(p[0], "tun-mtu-max") && p[1] && !p[2])
70157017
{
70167018
VERIFY_PERMISSION(OPT_P_MTU | OPT_P_CONNECTION);
70177019
int max_mtu = positive_atoi(p[1], msglevel);

src/openvpn/push.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ prepare_push_reply(struct context *c, struct gc_arena *gc, struct push_list *pus
721721
{
722722
msg(M_WARN,
723723
"Warning: reported maximum MTU from client (%d) is lower "
724-
"than MTU used on the server (%d). Add tun-max-mtu %d "
724+
"than MTU used on the server (%d). Add tun-mtu-max %d "
725725
"to client configuration.",
726726
client_max_mtu, o->ce.tun_mtu, o->ce.tun_mtu);
727727
}

0 commit comments

Comments
 (0)