From 586d0266fafbf208f0a27c636a2979aed68a4585 Mon Sep 17 00:00:00 2001 From: hengyoush Date: Mon, 9 Sep 2024 15:26:07 +0800 Subject: [PATCH] [Fix] when parse kernel version failed, fallback to compatible mode --- common/utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/utils.go b/common/utils.go index ea7b98a9..f8ff3209 100644 --- a/common/utils.go +++ b/common/utils.go @@ -219,5 +219,6 @@ func EnabledXdp() bool { func NeedsRunningInCompatibleMode() bool { kernel58, _ := version.NewVersion("5.8") - return viper.GetBool("compatible") || GetKernelVersion().LessThan(kernel58) + curKernelVersion := GetKernelVersion() + return viper.GetBool("compatible") || curKernelVersion == nil || curKernelVersion.LessThan(kernel58) }