public IP address autodiscovery #20

Merged
lx merged 10 commits from stun into main 2023-04-21 09:56:22 +00:00
Showing only changes of commit d27173a2b7 - Show all commits

View file

@ -54,6 +54,7 @@ pub fn get_opened_ports(ipt: &iptables::IPTables) -> Result<messages::PublicExpo
let re = Regex::new(r"\-A.*? \-p (\w+).*\-\-dport (\d+).*?\-j ACCEPT") let re = Regex::new(r"\-A.*? \-p (\w+).*\-\-dport (\d+).*?\-j ACCEPT")
.context("Regex matching open ports encountered an unexpected rule")?; .context("Regex matching open ports encountered an unexpected rule")?;
for i in list { for i in list {
debug!("{} list DIPLONAT: got {}", ipt.cmd, i);
let caps = re.captures(&i); let caps = re.captures(&i);
match caps { match caps {
Some(c) => { Some(c) => {
@ -70,7 +71,9 @@ pub fn get_opened_ports(ipt: &iptables::IPTables) -> Result<messages::PublicExpo
error!("Unexpected rule found in DIPLONAT chain") error!("Unexpected rule found in DIPLONAT chain")
} }
} }
_ => {} _ => {
debug!("{} rule not parsed: {}", ipt.cmd, i);
}
} }
} }