mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
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
20 lines
402 B
Go
20 lines
402 B
Go
//go:build linux
|
|
// +build linux
|
|
|
|
package quic
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
const msgTypeIPTOS = unix.IP_TOS
|
|
|
|
const (
|
|
ipv4RECVPKTINFO = unix.IP_PKTINFO
|
|
ipv6RECVPKTINFO = unix.IPV6_RECVPKTINFO
|
|
)
|
|
|
|
const (
|
|
msgTypeIPv4PKTINFO = unix.IP_PKTINFO
|
|
msgTypeIPv6PKTINFO = unix.IPV6_PKTINFO
|
|
)
|
|
|
|
const batchSize = 8 // needs to smaller than MaxUint8 (otherwise the type of oobConn.readPos has to be changed)
|