fix(proptest): don't use port 53 for non-dns packets (#7129)

For simplicity sake I assumed that any packet using port 53 would be a
dns packet, but I forgot to exclude it from the range of possible ports
used.

This can cause spurious CI failures
This commit is contained in:
Gabi
2024-10-22 21:05:28 -03:00
committed by GitHub
parent 8ad290f024
commit a803a54b02

View File

@@ -222,7 +222,7 @@ where
src.prop_map(Into::into),
dst.prop_map(Into::into),
any::<u16>(),
any::<u16>(),
non_dns_ports(),
any::<sample::Selector>(),
any::<u64>(),
)
@@ -250,7 +250,7 @@ where
src.prop_map(Into::into),
dst.prop_map(Into::into),
any::<u16>(),
any::<u16>(),
non_dns_ports(),
any::<sample::Selector>(),
any::<u64>(),
)
@@ -265,6 +265,13 @@ where
})
}
fn non_dns_ports() -> impl Strategy<Value = u16> {
any::<u16>().prop_filter(
"avoid using port 53 for non-dns queries for simplicity",
|p| *p != 53,
)
}
/// Samples up to 5 DNS queries that will be sent concurrently into connlib.
pub(crate) fn dns_queries(
domain: impl Strategy<Value = DomainName>,