1
0

fixing position for docker

This commit is contained in:
midefos 2024-08-14 19:51:04 +02:00
parent 965c76cfb1
commit 691584c46e

View File

@ -121,6 +121,13 @@ pub fn secure_port(
return Err("Err gathering secure port rule".into());
}
let position = if docker && position.is_none() {
let all_docker_rules = iptables.list("filter", &chain).unwrap();
Some(all_docker_rules.len() as i32 - 1)
} else {
position
};
let rule = rule.unwrap();
if let Some(position) = position {
insert_unique(&iptables, table, &chain, &rule, position)