Skip to content

Commit

Permalink
reload procmon method after fw rules
Browse files Browse the repository at this point in the history
There was a situation where if the ebpf modules path did not exist,
the fw rules were not added, causing the daemon to crash after
connecting to the GUI.
  • Loading branch information
gustavo-iniguez-goya committed Dec 17, 2024
1 parent 7d2ca8d commit c526907
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions daemon/ui/config_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,6 @@ func (c *Client) reloadConfiguration(reload bool, newConfig config.Config) *moni
} else {
log.Debug("[config] config.Ebpf.ModulesPath not changed")
}
if reloadProc {
err := monitor.ReconfigureMonitorMethod(newConfig.ProcMonitorMethod, newConfig.Ebpf)
if err != nil && err.What > monitor.NoError {
return err
}
} else {
log.Debug("[config] config.procmon not changed")
}

// 3. load fw
reloadFw := false
Expand All @@ -220,6 +212,16 @@ func (c *Client) reloadConfiguration(reload bool, newConfig config.Config) *moni
log.Debug("[config] config.firewall not changed")
}

// 4. reload procmon if needed
if reloadProc {
err := monitor.ReconfigureMonitorMethod(newConfig.ProcMonitorMethod, newConfig.Ebpf)
if err != nil && err.What > monitor.NoError {
return err
}
} else {
log.Debug("[config] config.procmon not changed")
}

if (reloadProc || reloadFw) && newConfig.Internal.FlushConnsOnStart {
log.Debug("[config] flushing established connections")
netlink.FlushConnections()
Expand Down

0 comments on commit c526907

Please sign in to comment.