fix: add an unmap before is6
This commit is contained in:
parent
57dfaf135d
commit
f657ac97f6
2 changed files with 2 additions and 2 deletions
|
@ -334,7 +334,7 @@ type hyDialerWithContext struct {
|
||||||
func (h *hyDialerWithContext) ListenPacket(rAddr net.Addr) (net.PacketConn, error) {
|
func (h *hyDialerWithContext) ListenPacket(rAddr net.Addr) (net.PacketConn, error) {
|
||||||
network := "udp"
|
network := "udp"
|
||||||
if addrPort, err := netip.ParseAddrPort(rAddr.String()); err == nil {
|
if addrPort, err := netip.ParseAddrPort(rAddr.String()); err == nil {
|
||||||
if addrPort.Addr().Is6() {
|
if addrPort.Addr().Unmap().Is6() {
|
||||||
network = "udp6"
|
network = "udp6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ func (t *Tuic) dial(ctx context.Context, opts ...dialer.Option) (pc net.PacketCo
|
||||||
}
|
}
|
||||||
addr = udpAddr
|
addr = udpAddr
|
||||||
network := "udp"
|
network := "udp"
|
||||||
if udpAddr.AddrPort().Addr().Is6() {
|
if udpAddr.AddrPort().Addr().Unmap().Is6() {
|
||||||
network = "udp6"
|
network = "udp6"
|
||||||
}
|
}
|
||||||
pc, err = dialer.ListenPacket(ctx, network, "", opts...)
|
pc, err = dialer.ListenPacket(ctx, network, "", opts...)
|
||||||
|
|
Loading…
Reference in a new issue