Use String to compare net address

Use String to compare net address
This commit is contained in:
cnderrauber
2022-10-10 20:22:30 +08:00
committed by cnderrauber
parent a70c38101c
commit 41b77f19a5
+1 -1
View File
@@ -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()