Skip to content

Commit

Permalink
use a v4-only socket in DPLPMTUD test
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 7, 2024
1 parent 03d1f6e commit b6d6d52
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions integrationtests/self/dplpmtud_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// We can't reliably set the DF bit on macOS, so we can't do Path MTU discovery.
//go:build !darwin

package self_test

import (
Expand Down Expand Up @@ -65,9 +62,16 @@ var _ = Describe("DPLPMTUD", func() {
Expect(err).ToNot(HaveOccurred())
defer proxy.Close()

conn, err := quic.DialAddr(
// Make sure to use v4-only socket here.
// We can't reliably set the DF bit on dual-stack sockets on macOS.
udpConn, err := net.ListenUDP("udp4", &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 0})
Expect(err).ToNot(HaveOccurred())
defer udpConn.Close()
tr := &quic.Transport{Conn: udpConn}
defer tr.Close()
conn, err := tr.Dial(
context.Background(),
fmt.Sprintf("localhost:%d", proxy.LocalPort()),
proxy.LocalAddr(),
getTLSClientConfig(),
getQuicConfig(nil),
)
Expand Down

0 comments on commit b6d6d52

Please sign in to comment.