fix: 解决 Firewalld 防火墙列表显示不全的问题 (#5684)

This commit is contained in:
ssongliu 2024-07-04 22:32:34 +08:00 committed by GitHub
parent 966b10fbb5
commit 9ca69732ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,7 +108,7 @@ func (f *Firewall) ListPort() ([]FireInfo, error) {
continue
}
itemRule := f.loadInfo(rule)
if (len(itemRule.Port) != 0 && itemRule.Family == "ipv4") || (itemRule.Family == "ipv6" && len(itemRule.Address) != 0) {
if len(itemRule.Port) != 0 && (itemRule.Family == "ipv4" || (itemRule.Family == "ipv6" && len(itemRule.Address) != 0)) {
datas = append(datas, itemRule)
}
}