Skip to content

Commit

Permalink
Specify udp4 in piondtls.Dial
Browse files Browse the repository at this point in the history
pion/dtls uses net.ListenUDP under the hood to allow for changing remote
addresses. Therefore, if there is a mismatch between IPv4 and IPv6
between the client and server then they are unable to communicate.
Additionally, writing to 0.0.0.0 fails on Windows, so 127.0.0.1 is
specified explicitly.

Signed-off-by: Daniel Mangum <[email protected]>
  • Loading branch information
hasheddan authored and jkralik committed Aug 29, 2023
1 parent 6ecbb1e commit 4f8f9da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dtls/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func TestServerKeepAliveMonitor(t *testing.T) {
require.NoError(t, errS)
}()

cc, err := piondtls.Dial("udp", ld.Addr().(*net.UDPAddr), clientCgf)
cc, err := piondtls.Dial("udp4", &net.UDPAddr{IP: []byte{127, 0, 0, 1}, Port: ld.Addr().(*net.UDPAddr).Port}, clientCgf)
require.NoError(t, err)

p := pool.NewMessage(ctx)
Expand Down

0 comments on commit 4f8f9da

Please sign in to comment.