From 15d2dc3a4f1bc528283ff77f03bc37ffb2987ccc Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Tue, 13 Apr 2021 13:59:58 +0200 Subject: [PATCH] lib/connections: Add SyscallConn() to quic conn (fixes #7551) (#7570) --- lib/connections/quic_listen.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/connections/quic_listen.go b/lib/connections/quic_listen.go index e8bd8d111..5c90cfff4 100644 --- a/lib/connections/quic_listen.go +++ b/lib/connections/quic_listen.go @@ -16,6 +16,7 @@ import ( "strings" "sync" "sync/atomic" + "syscall" "time" "github.com/lucas-clemente/quic-go" @@ -223,7 +224,12 @@ type stunConnQUICWrapper struct { underlying *net.UDPConn } -// SetReadBuffer is required by QUIC. +// SetReadBuffer is required by QUIC < v0.20.0 func (s *stunConnQUICWrapper) SetReadBuffer(size int) error { return s.underlying.SetReadBuffer(size) } + +// SyscallConn is required by QUIC +func (s *stunConnQUICWrapper) SyscallConn() (syscall.RawConn, error) { + return s.underlying.SyscallConn() +}