Commit Graph

13 Commits

Author SHA1 Message Date
Toby
ad1cb27c1b move set DF implementation to separate files & avoid the need for OOBCapablePacketConn (#3334)
* move set DF implementation to separate files & avoid the need for OOBCapablePacketConn

* merge err_size_* into conn_df_* & fix format
2022-03-07 15:21:23 +01:00
Rachel Chen
fd2c345152 sendQueue: ignore "datagram too large" error (#3328)
This commit introduces additional platform-dependent checking when the
kernel returns an error. Previously, the session is terminated when
PingFrame sends a discovery packet larger than the limit. With this
commit, the error is checked, and if it is "datagram too large", the
error is ignored.

Additionally,
1. This commit re-enables MTU discovery on Windows unless it
is disabled explicitly by user (Undo #3276),
2. Set IP_DONTFRAGMENT and IPV6_DONTFRAG with error checking on Windows,
   and
3. Set IP_MTU_DISCOVERY to PMTUDISC_DO for both IPv4 and IPv6 on Linux
   so that the kernel will return "message too long".

Fixes #3273 #3327
2022-02-20 00:21:32 -08:00
Marten Seemann
d410b590e9 disable Path MTU Discovery on Windows 2021-09-17 18:24:26 +02:00
Marten Seemann
59ea0daea1 run gofmt to add the new go:build tags 2021-09-14 18:37:41 +02:00
Marten Seemann
22a703b669 fix DONT_FRAGMENT error when using a IPv6 connection on Windows
The syscall setting the IP_DONTFRAGMENT socket option will fail if the
underlying connection is a IPv6 connection. Since Go doesn't allow us to
distinguish between IPv6 and dual-stack connections, we can only ignore the
error here.
2021-05-11 12:33:40 -07:00
Toby
84e03e5976 set the don't fragment (DF) bit on Windows (#3155) 2021-04-21 12:39:39 +07:00
Marten Seemann
162cb16b31 cache the serialized OOB in the conn, not in the packet info
We're allocating a lot of packetInfo structs during the lifetime of a
connection. It's better to keep that struct as small as possible.
2021-03-16 14:04:15 +08:00
Marten Seemann
f59cd928f8 use golang.org/x/sys/unix instead of syscall 2020-12-06 12:06:15 +07:00
Marten Seemann
9d9307495b set the UDP receive buffer size on Windows 2020-11-21 17:49:39 +07:00
Marten Seemann
631e37cc70 only use syscalls on platforms that we're actually testing 2020-11-18 19:00:07 +07:00
Marten Seemann
14a5aa831d increase UDP receive buffer size 2020-10-19 10:42:44 +07:00
Marten Seemann
833027b065 introduce an ECNCapablePacketConn interface to determine ECN support 2020-09-15 14:41:06 +07:00
Marten Seemann
ea3d32394d read the ECN bits 2020-09-15 10:51:22 +07:00