浏览代码

fixup! feat: Add MLDv2 Listener Query response support

Koen Zandberg 7 月之前
父节点
当前提交
41be841b47
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/iface/interface/multicast.rs

+ 4 - 2
src/iface/interface/multicast.rs

@@ -499,8 +499,10 @@ impl InterfaceInner {
                 max_resp_code,
                 ..
             } => {
-                // Do not respont immediately to the query
-                let delay = crate::time::Duration::from_millis(max_resp_code.into()) / 3;
+                // Do not respont immediately to the query, but wait a random time
+                let delay = crate::time::Duration::from_millis(
+                    (self.rand.rand_u16() % max_resp_code).into(),
+                );
                 // General query
                 if mcast_addr.is_unspecified()
                     && (ip_repr.dst_addr == IPV6_LINK_LOCAL_ALL_NODES