From f07671cf49155aa3c641042e51b5502934c4d4c8 Mon Sep 17 00:00:00 2001 From: braginini Date: Thu, 8 Sep 2022 19:39:05 +0200 Subject: [PATCH] Fix RemoveConnByUfrag --- iface/udp_mux.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iface/udp_mux.go b/iface/udp_mux.go index 23dfeb4b2..0b9a50e2e 100644 --- a/iface/udp_mux.go +++ b/iface/udp_mux.go @@ -176,7 +176,15 @@ func (m *UDPMuxDefault) RemoveConnByUfrag(ufrag string) { for _, c := range removedConns { addresses := c.getAddresses() for _, addr := range addresses { - delete(m.addressMap, addr) + if connList, ok := m.addressMap[addr]; ok { + var newList []*udpMuxedConn + for _, conn := range connList { + if conn.params.Key != ufrag { + newList = append(newList, conn) + } + } + m.addressMap[addr] = newList + } } } }