From 3e774db52297a447c7404602cb81c9ab5e3c4404 Mon Sep 17 00:00:00 2001 From: Linus Gasser Date: Thu, 21 Nov 2024 11:06:43 +0100 Subject: [PATCH] Closing mdns agent (#636) I use the library with many open/close, and I get mdns storms where the webrtc library searches for other nodes over the network in a very aggressive manner. This has been proposed by @r-byondlabs, and might very well be the problem: if I open/close many connections, and the mdns-agents are not cleaned up, there might be many requests. Fixes #616 --- ice/src/agent/mod.rs | 2 ++ sctp/fuzz/fuzz_targets/packet.rs | 2 +- sctp/fuzz/fuzz_targets/param.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ice/src/agent/mod.rs b/ice/src/agent/mod.rs index f8bece6d5..6e4111bfa 100644 --- a/ice/src/agent/mod.rs +++ b/ice/src/agent/mod.rs @@ -349,6 +349,8 @@ impl Agent { udp_mux.remove_conn_by_ufrag(&ufrag).await; } + Self::close_multicast_conn(&self.mdns_conn).await; + //FIXME: deadlock here self.internal.close().await } diff --git a/sctp/fuzz/fuzz_targets/packet.rs b/sctp/fuzz/fuzz_targets/packet.rs index 65a92c5b7..1e6ce69f6 100644 --- a/sctp/fuzz/fuzz_targets/packet.rs +++ b/sctp/fuzz/fuzz_targets/packet.rs @@ -1,8 +1,8 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use webrtc_sctp::packet::Packet; use bytes::Bytes; +use webrtc_sctp::packet::Packet; fuzz_target!(|data: &[u8]| { let bytes = Bytes::from(data.to_vec()); diff --git a/sctp/fuzz/fuzz_targets/param.rs b/sctp/fuzz/fuzz_targets/param.rs index 7677edf6e..40489b39a 100644 --- a/sctp/fuzz/fuzz_targets/param.rs +++ b/sctp/fuzz/fuzz_targets/param.rs @@ -1,8 +1,8 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use webrtc_sctp::param::build_param; use bytes::Bytes; +use webrtc_sctp::param::build_param; fuzz_target!(|data: &[u8]| { let bytes = Bytes::from(data.to_vec());