mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-14 16:25:57 -05:00
fix: panic in dns over quic when address is a ip
This commit is contained in:
parent
e102d52e7c
commit
5c995d97f4
@ -378,7 +378,16 @@ func (s *QUICNameServer) getConnection(ctx context.Context) (quic.Connection, er
|
||||
|
||||
func (s *QUICNameServer) openConnection(ctx context.Context) (quic.Connection, error) {
|
||||
tlsConfig := tls.Config{
|
||||
ServerName: s.destination.Address.Domain(),
|
||||
ServerName: func() string {
|
||||
switch s.destination.Address.Family() {
|
||||
case net.AddressFamilyIPv4, net.AddressFamilyIPv6:
|
||||
return s.destination.Address.IP().String()
|
||||
case net.AddressFamilyDomain:
|
||||
return s.destination.Address.Domain()
|
||||
default:
|
||||
panic("unknown address family")
|
||||
}
|
||||
}(),
|
||||
}
|
||||
quicConfig := &quic.Config{
|
||||
HandshakeIdleTimeout: handshakeIdleTimeout,
|
||||
|
Loading…
Reference in New Issue
Block a user