feat: refactor interception modules into pausable group

- Add GroupModule to wrap interception, dnsmonitor, and compat modules
- Simplify pause/resume operations by grouping related modules
- Update worker info collection to handle nested module groups
- Remove deprecated flags and improve module lifecycle management
- Add proper atomic state tracking for nfqueue interception

https://github.com/safing/portmaster/issues/2050
This commit is contained in:
Alexandr Stelnykovych
2025-11-06 17:28:38 +02:00
parent 7709a6600c
commit 4d2d91972b
8 changed files with 93 additions and 55 deletions

View File

@@ -68,16 +68,9 @@ func (c *Control) pause(duration time.Duration, onlySPN bool) (retErr error) {
}
if !c.pauseInfo.Interception {
modulesToResume := []mgr.Module{
c.instance.Compat(),
c.instance.Interception(),
if err := c.instance.InterceptionGroup().Stop(); err != nil {
return err
}
for _, m := range modulesToResume {
if err := m.Stop(); err != nil {
return err
}
}
c.mgr.Info("interception paused")
c.pauseInfo.Interception = true
}
@@ -106,14 +99,8 @@ func (c *Control) resume() (retErr error) {
c.stopResumeWorker()
if c.pauseInfo.Interception {
modulesToResume := []mgr.Module{
c.instance.Interception(),
c.instance.Compat(),
}
for _, m := range modulesToResume {
if err := m.Start(); err != nil {
return err
}
if err := c.instance.InterceptionGroup().Start(); err != nil {
return err
}
c.mgr.Info("interception resumed")
c.pauseInfo.Interception = false