Skip to content

Commit

Permalink
call to .iter().any() should be .iter().all()
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus0x62 authored and bluejekyll committed Jan 1, 2024
1 parent 1a4f26e commit 2f21bd3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/proto/src/udp/udp_client_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,9 @@ async fn send_serial_message_inner<S: DnsUdpSocket + Send>(
let request_queries = request_message.queries();
let response_queries = message.queries();

if !response_queries.is_empty()
&& !response_queries
.iter()
.any(|elem| request_queries.contains(elem))
if !response_queries
.iter()
.all(|elem| request_queries.contains(elem))
{
warn!("detected forged question section: we expected '{:?}', but received '{:?}' from server {}",
&request_queries, &response_queries, src);
Expand Down

0 comments on commit 2f21bd3

Please sign in to comment.