mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 00:24:40 +01:00
reload procmon method after fw rules
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.
This commit is contained in:
parent
7d2ca8d039
commit
c526907d75
1 changed files with 10 additions and 8 deletions
|
@ -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
|
||||
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue