From 41b77f19a5afa671cd5d4dde9dc532a8cf17fb06 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Sun, 9 Oct 2022 22:56:52 +0800 Subject: [PATCH] Use String to compare net address Use String to compare net address --- udp_mux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udp_mux.go b/udp_mux.go index 9914346..8b39f83 100644 --- a/udp_mux.go +++ b/udp_mux.go @@ -124,7 +124,7 @@ func (m *UDPMuxDefault) GetListenAddresses() []net.Addr { // creates the connection if an existing one can't be found func (m *UDPMuxDefault) GetConn(ufrag string, addr net.Addr) (net.PacketConn, error) { // don't check addr for mux using unspecified address - if len(m.localAddrsForUnspecified) == 0 && m.params.UDPConn.LocalAddr() != addr { + if len(m.localAddrsForUnspecified) == 0 && m.params.UDPConn.LocalAddr().String() != addr.String() { return nil, errInvalidAddress } m.mu.Lock()