mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-15 10:25:40 +00:00
chore: update Rust to 2024 edition (#2066)
This commit is contained in:
@@ -507,7 +507,7 @@ impl AclProcessor {
|
||||
matched_rule: Some(RuleId::Default),
|
||||
should_log: false,
|
||||
log_context: Some(AclLogContext::UnsupportedChainType),
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -679,28 +679,28 @@ impl AclProcessor {
|
||||
}
|
||||
|
||||
// Source port check
|
||||
if let Some(src_port) = packet_info.src_port {
|
||||
if !rule.src_port_ranges.is_empty() {
|
||||
let matches = rule
|
||||
.src_port_ranges
|
||||
.iter()
|
||||
.any(|(start, end)| src_port >= *start && src_port <= *end);
|
||||
if !matches {
|
||||
return false;
|
||||
}
|
||||
if let Some(src_port) = packet_info.src_port
|
||||
&& !rule.src_port_ranges.is_empty()
|
||||
{
|
||||
let matches = rule
|
||||
.src_port_ranges
|
||||
.iter()
|
||||
.any(|(start, end)| src_port >= *start && src_port <= *end);
|
||||
if !matches {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Destination port check
|
||||
if let Some(dst_port) = packet_info.dst_port {
|
||||
if !rule.dst_port_ranges.is_empty() {
|
||||
let matches = rule
|
||||
.dst_port_ranges
|
||||
.iter()
|
||||
.any(|(start, end)| dst_port >= *start && dst_port <= *end);
|
||||
if !matches {
|
||||
return false;
|
||||
}
|
||||
if let Some(dst_port) = packet_info.dst_port
|
||||
&& !rule.dst_port_ranges.is_empty()
|
||||
{
|
||||
let matches = rule
|
||||
.dst_port_ranges
|
||||
.iter()
|
||||
.any(|(start, end)| dst_port >= *start && dst_port <= *end);
|
||||
if !matches {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user