Change to expandable switch-based firewall detection.

This commit is contained in:
cameronts
2022-08-03 12:18:04 -07:00
parent eab23b7022
commit 7c2fce3a55
4 changed files with 64 additions and 55 deletions

View File

@@ -114,14 +114,14 @@ func JoinNetwork(cfg *config.ClientConfig, privateKey string) error {
if ncutils.IsFreeBSD() {
cfg.Node.UDPHolePunch = "no"
cfg.Node.IsNFTablesPresent = "no" // nftables not supported by FreeBSD
cfg.Node.FirewallInUse = models.FIREWALL_IPTABLES // nftables not supported by FreeBSD
}
if cfg.Node.IsNFTablesPresent == "" {
if cfg.Node.FirewallInUse == "" {
if ncutils.IsNFTablesPresent() {
cfg.Node.IsNFTablesPresent = "yes"
cfg.Node.FirewallInUse = models.FIREWALL_NFTABLES
} else {
cfg.Node.IsNFTablesPresent = "no"
cfg.Node.FirewallInUse = models.FIREWALL_IPTABLES
}
}