Failure to compare strings with eBPF
问题 When I run the following code I get an error. #include <uapi/linux/utsname.h> #include <linux/pid_namespace.h> struct uts_namespace { struct kref kref; struct new_utsname name; }; static __always_inline char * get_task_uts_name(struct task_struct *task){ return task->nsproxy->uts_ns->name.nodename; } int cmpNamespace(void *ctx) { struct task_struct *task; task = (struct task_struct *)bpf_get_current_task(); if (strcmp(get_task_uts_name(task),"namespace")==0){ ... } return 0; } Error: bpf: