diff --git a/config.go b/config.go index 05f8248e..d80e965a 100644 --- a/config.go +++ b/config.go @@ -106,6 +106,7 @@ func populateConfig(config *Config) *Config { StatelessResetKey: config.StatelessResetKey, TokenStore: config.TokenStore, EnableDatagrams: config.EnableDatagrams, + DisablePathMTUDiscovery: config.DisablePathMTUDiscovery, Tracer: config.Tracer, } } diff --git a/config_test.go b/config_test.go index 024e9eb2..9e42eec4 100644 --- a/config_test.go +++ b/config_test.go @@ -71,6 +71,8 @@ var _ = Describe("Config", func() { f.Set(reflect.ValueOf(true)) case "EnableDatagrams": f.Set(reflect.ValueOf(true)) + case "DisablePathMTUDiscovery": + f.Set(reflect.ValueOf(true)) case "Tracer": f.Set(reflect.ValueOf(mocklogging.NewMockTracer(mockCtrl))) default: @@ -144,6 +146,7 @@ var _ = Describe("Config", func() { Expect(c.MaxReceiveConnectionFlowControlWindow).To(BeEquivalentTo(protocol.DefaultMaxReceiveConnectionFlowControlWindow)) Expect(c.MaxIncomingStreams).To(BeEquivalentTo(protocol.DefaultMaxIncomingStreams)) Expect(c.MaxIncomingUniStreams).To(BeEquivalentTo(protocol.DefaultMaxIncomingUniStreams)) + Expect(c.DisablePathMTUDiscovery).To(BeFalse()) }) It("populates empty fields with default values, for the server", func() { diff --git a/interface.go b/interface.go index 91e36260..6b5a0176 100644 --- a/interface.go +++ b/interface.go @@ -266,6 +266,9 @@ type Config struct { StatelessResetKey []byte // KeepAlive defines whether this peer will periodically send a packet to keep the connection alive. KeepAlive bool + // DisablePathMTUDiscovery disables Path MTU Discovery (RFC 8899). + // Packets will then be at most 1252 (IPv4) / 1232 (IPv6) bytes in size. + DisablePathMTUDiscovery bool // See https://datatracker.ietf.org/doc/draft-ietf-quic-datagram/. // Datagrams will only be available when both peers enable datagram support. EnableDatagrams bool