Re: [PATCH] samples/bpf: Fix sockex3: missing BPF prog type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 27, 2022 at 6:01 PM Rong Tao <rtoax@xxxxxxxxxxx> wrote:
>
> Thanks for your reply, actually, i tried another method, which can solved
> this error, recognize "socket/xxx" as "socket". However, it maybe influence
> other BPF prog or not? What do you think the following patch?

Don't fix libbpf, it's not broken. Fix the sample.

>
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -8659,7 +8659,7 @@ static bool sec_def_matches(const struct bpf_sec_def *sec_def, const char *sec_n
>                 return false;
>         }
>
> -       return strcmp(sec_name, sec_def->sec) == 0;
> +       return strncmp(sec_name, sec_def->sec, len) == 0;
>  }



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux