forked from quic-go/quic-go
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.
This commit is contained in:
@@ -10,13 +10,23 @@ import (
|
||||
)
|
||||
|
||||
var _ = Describe("Windows Conn Test", func() {
|
||||
It("try newConn", func() {
|
||||
It("works on IPv4", func() {
|
||||
addr, err := net.ResolveUDPAddr("udp4", "localhost:0")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
udpConn, err := net.ListenUDP("udp4", addr)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
conn, err := newConn(udpConn)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
_ = conn.Close()
|
||||
Expect(conn.Close()).To(Succeed())
|
||||
})
|
||||
|
||||
It("works on IPv6", func() {
|
||||
addr, err := net.ResolveUDPAddr("udp6", "[::1]:0")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
udpConn, err := net.ListenUDP("udp6", addr)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
conn, err := newConn(udpConn)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(conn.Close()).To(Succeed())
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user