From 8256b0358de65798b1b5ea8360d13b18254f09cc Mon Sep 17 00:00:00 2001 From: midefos Date: Sun, 9 Jun 2024 15:32:53 +0200 Subject: [PATCH] better rule contains --- src/iptables_wrapper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iptables_wrapper.rs b/src/iptables_wrapper.rs index ab74c39..1bc06b5 100644 --- a/src/iptables_wrapper.rs +++ b/src/iptables_wrapper.rs @@ -8,7 +8,7 @@ pub fn is_port_secured(port: u16, docker: bool) -> bool { } for rule in rules.unwrap() { - if rule.contains(&format!("-p tcp --dport {} -j DROP", port)) { + if rule.contains(&format!("-p tcp -m tcp --dport {} -j DROP", port)) { return true; } }