Skip to content

Commit

Permalink
quic: don't claim to be able to dial draft-29 in CanDial (#2520)
Browse files Browse the repository at this point in the history
* quic: don't claim to be able to dial draft-29 in CanDial

* fix comment
  • Loading branch information
marten-seemann authored Aug 25, 2023
1 parent 405af03 commit 8303f80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p2p/transport/quic/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ loop:
}
}

// Don't use mafmt.QUIC as we don't want to dial DNS addresses. Just /ip{4,6}/udp/quic
var dialMatcher = mafmt.And(mafmt.IP, mafmt.Base(ma.P_UDP), mafmt.Or(mafmt.Base(ma.P_QUIC), mafmt.Base(ma.P_QUIC_V1)))
// Don't use mafmt.QUIC as we don't want to dial DNS addresses. Just /ip{4,6}/udp/quic-v1
var dialMatcher = mafmt.And(mafmt.IP, mafmt.Base(ma.P_UDP), mafmt.Base(ma.P_QUIC_V1))

// CanDial determines if we can dial to an address
func (t *transport) CanDial(addr ma.Multiaddr) bool {
Expand Down
1 change: 1 addition & 0 deletions p2p/transport/quic/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func TestCanDial(t *testing.T) {
"/ip4/127.0.0.1/udp/1234",
"/ip4/5.5.5.5/tcp/1234",
"/dns/google.com/udp/443/quic-v1",
"/ip4/127.0.0.1/udp/1234/quic",
}
valid := []string{
"/ip4/127.0.0.1/udp/1234/quic-v1",
Expand Down

0 comments on commit 8303f80

Please sign in to comment.