Skip to content

Commit

Permalink
fix crash when deleting disabled rule
Browse files Browse the repository at this point in the history
  • Loading branch information
pythops committed Oct 7, 2024
1 parent 8b19b07 commit a2ce3f0
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions oryx-tui/src/ebpf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,7 @@ fn update_ipv4_blocklist(
}
}
}
}
// no hashmap entry, create new blocklist
else {
// shouldn't be disabling if blocklist is empty
assert!(enabled);

} else if enabled {
let mut blocked_ports: [u16; 32] = [0; 32];
match port {
BlockedPort::Single(port) => {
Expand Down Expand Up @@ -189,12 +184,7 @@ fn update_ipv6_blocklist(
}
}
}
}
// no hashmap entry, create new blocklist
else {
// shouldn't be disabling if blocklist is empty
assert!(enabled);

} else if enabled {
let mut blocked_ports: [u16; 32] = [0; 32];
match port {
BlockedPort::Single(port) => {
Expand Down

0 comments on commit a2ce3f0

Please sign in to comment.