Skip to content

Commit ee9e1e0

Browse files
authored
[CWS] don't start the tc classifier loop if network is disabled (#46062)
### What does this PR do? No need to start the tc classifier loop if network is disabled in the probe. ### Motivation ### Describe how you validated your changes ### Additional Notes Co-authored-by: paul.cacheux <paul.cacheux@datadoghq.com>
1 parent f659f1e commit ee9e1e0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pkg/security/probe/probe_ebpf.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,14 @@ func (p *EBPFProbe) Start() error {
789789
// Apply rules to the already stored data before starting the event stream to avoid concurrency issues
790790
p.replayEvents(true)
791791

792-
// start new tc classifier loop
793-
p.wg.Add(1)
794-
go func() {
795-
defer p.wg.Done()
796-
p.startSetupNewTCClassifierLoop()
797-
}()
792+
if p.probe.IsNetworkEnabled() {
793+
// start new tc classifier loop
794+
p.wg.Add(1)
795+
go func() {
796+
defer p.wg.Done()
797+
p.startSetupNewTCClassifierLoop()
798+
}()
799+
}
798800

799801
if p.config.RuntimeSecurity.IsSysctlSnapshotEnabled() {
800802
// start sysctl snapshot loop

0 commit comments

Comments
 (0)