diff --git a/pkg/network/tracer/connection/kprobe/tracer.go b/pkg/network/tracer/connection/kprobe/tracer.go index 52d7f6737c50f7..0fd21dd880531e 100644 --- a/pkg/network/tracer/connection/kprobe/tracer.go +++ b/pkg/network/tracer/connection/kprobe/tracer.go @@ -53,6 +53,8 @@ var ( tracerOffsetGuesserRunner = offsetguess.TracerOffsets.Offsets errCORETracerNotSupported = errors.New("CO-RE tracer not supported on this platform") + + rhel9KernelVersion = kernel.VersionCode(5, 14, 0) ) // ClassificationSupported returns true if the current kernel version supports the classification feature. @@ -71,7 +73,23 @@ func ClassificationSupported(config *config.Config) bool { return false } - return currentKernelVersion >= classificationMinimumKernel + if currentKernelVersion < classificationMinimumKernel { + return false + } + + // TODO: fix protocol classification is not supported on RHEL 9+ + family, err := kernel.Family() + if err != nil { + log.Warnf("could not determine OS family: %s", err) + return false + } + + if family == "rhel" && currentKernelVersion >= rhel9KernelVersion { + log.Warn("protocol classification is currently not supported on RHEL 9+") + return false + } + + return true } // LoadTracer loads the co-re/prebuilt/runtime compiled network tracer, depending on config