File tree Expand file tree Collapse file tree
src/module/scripts/network Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -488,18 +488,23 @@ check_kernel_feature() {
488488 local feature=" $1 "
489489 local config_name=" CONFIG_${feature} "
490490
491+ # Check compile-time config (/proc/config.gz)
491492 if [ -f " $TMPDIR /kernel_config.cache" ]; then
492493 if grep -qE " ^${config_name} =[ym]$" " $TMPDIR /kernel_config.cache" 2> /dev/null; then
493- log Debug " Kernel feature $feature is enabled"
494+ log Debug " Kernel feature $feature is enabled (config) "
494495 return 0
495- else
496- log Warn " Kernel feature $feature is disabled or not found"
497- return 1
498496 fi
499- else
500- log Warn " Kernel config cache not available, cannot check $feature "
501- return 1
502497 fi
498+
499+ # check runtime loaded modules (/sys/module/)
500+ local module_name=$( echo " $feature " | tr ' A-Z' ' a-z' )
501+ if [ -d " /sys/module/$module_name " ]; then
502+ log Debug " Kernel feature $feature is enabled (loaded module)"
503+ return 0
504+ fi
505+
506+ log Warn " Kernel feature $feature is disabled or not found"
507+ return 1
503508}
504509
505510check_tproxy_support () {
You can’t perform that action at this time.
0 commit comments