diff options
author | Gert Doering | 2022-02-22 12:38:32 +0100 |
---|---|---|
committer | Gert Doering | 2022-02-22 13:23:32 +0100 |
commit | 4225114b96723bdecd68398f7a89765879b31b5d (patch) | |
tree | e79b1ce55470edebf9622542def98fb543710138 /src/openvpn/mss.c | |
parent | 055605783ee08767d871fbeffb6871368bdf1ada (diff) | |
download | openvpn-4225114b96723bdecd68398f7a89765879b31b5d.zip openvpn-4225114b96723bdecd68398f7a89765879b31b5d.tar.gz |
Fix --mtu-disc maybe|yes on Linux.
--mtu-disc (on Linux) needs two components to work:
- setsockopt() with IP_MTU_DISCOVER or IPV6_MTU_DISCOVER
- "extended error reporting" (setsockopt(IP_RECVERR) and
then via mtu.c/format_extended_socket_error()) to react on
"packet too big" errors on sendto() / sendmsg()
Some configure.ac reorganization broke detection of <linux/errqueue.h>
and "struct sock_extended_err". Re-add <linux/errqueue.h> to configure.ac,
remove all the other conditionals in syshead.h, and remove the
"struct sock_extended_err" check completely (assumption: if errqueue.h
exists, it contains what we need).
Thus, the "non-helpful" socket error message turns into:
2022-02-22 12:31:42 write UDPv4 [EMSGSIZE Path-MTU=800]: Message too long (fd=3,code=90)
2022-02-22 12:31:42 Note adjusting 'mssfix 1400 mtu' to 'mssfix 800 mtu' according to path MTU discovery
2022-02-22 12:31:42 Note adjusting 'fragment 1400 mtu' to 'fragment 800 mtu' according to path MTU discovery
... while at it, fix extra space in first part of these messages, and
print o->ce.fragment for the "fragment" message...
v2: assume that "if it's linux, and has these two headers, everything
else will be there as well" and get rid of most of the #ifdef checks
Trac: #1452
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20220222113832.13383-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23863.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/mss.c')
-rw-r--r-- | src/openvpn/mss.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openvpn/mss.c b/src/openvpn/mss.c index 81692e9..25b2640 100644 --- a/src/openvpn/mss.c +++ b/src/openvpn/mss.c @@ -361,7 +361,7 @@ frame_adjust_path_mtu(struct context *c) || (o->ce.mssfix_encap && pmtu < o->ce.mssfix + encap_overhead)) { const char* mtustr = o->ce.mssfix_encap ? " mtu" : ""; - msg(D_MTU_INFO, "Note adjusting 'mssfix %d %s' to 'mssfix %d mtu' " + msg(D_MTU_INFO, "Note adjusting 'mssfix %d%s' to 'mssfix %d mtu' " "according to path MTU discovery", o->ce.mssfix, mtustr, pmtu); o->ce.mssfix = pmtu; @@ -374,8 +374,8 @@ frame_adjust_path_mtu(struct context *c) (o->ce.fragment_encap && pmtu < o->ce.fragment + encap_overhead)) { const char* mtustr = o->ce.fragment_encap ? " mtu" : ""; - msg(D_MTU_INFO, "Note adjusting 'fragment %d %s' to 'fragment %d mtu' " - "according to path MTU discovery", o->ce.mssfix, + msg(D_MTU_INFO, "Note adjusting 'fragment %d%s' to 'fragment %d mtu' " + "according to path MTU discovery", o->ce.fragment, mtustr, pmtu); o->ce.fragment = pmtu; o->ce.fragment_encap = true; |