Skip to content

Commit

Permalink
removed fw rules initialization from main
Browse files Browse the repository at this point in the history
now they're added after loading the configuration.
  • Loading branch information
gustavo-iniguez-goya committed May 11, 2024
1 parent 64a698f commit bc32094
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ func main() {
log.Fatal("Error accessing rules path (does it exist?): %s", err)
}

if cfg.FwOptions.ConfigPath == "" {
cfg.FwOptions.ConfigPath = fwConfigFile
}
log.Info("Using system fw configuration %s ...", fwConfigFile)

setupSignals()

log.Info("Loading rules from %s ...", rulesPath)
Expand All @@ -592,20 +597,7 @@ func main() {
setupWorkers()
setupQueues()

fwConfigPath := fwConfigFile
if fwConfigPath == "" {
fwConfigPath = cfg.FwOptions.ConfigPath
}
log.Info("Using system fw configuration %s ...", fwConfigPath)
// queue is ready, run firewall rules and start intercepting connections
if err = firewall.Init(
uiClient.GetFirewallType(),
fwConfigPath,
cfg.FwOptions.MonitorInterval,
&queueNum); err != nil {
log.Warning("%s", err)
uiClient.SendWarningAlert(err)
}
// queue and firewall rules should be ready by now

uiClient.Connect()
listenToEvents()
Expand Down

0 comments on commit bc32094

Please sign in to comment.