Re: [PATCH bpf-next v1 1/7] tools: bpftool: fix infinite loop

From: Jakub Kicinski
Date: Wed Mar 20 2019 - 16:54:16 EST


On Wed, 20 Mar 2019 18:33:26 +0100, Alban Crequy wrote:
> From: Alban Crequy <alban@xxxxxxxxxx>
>
> Symptoms: when forgetting to type the keyword 'type' in front of 'hash':
> $ sudo bpftool map create /sys/fs/bpf/dir/foobar hash key 8 value 8 entries 128
> (infinite loop, taking all the CPU)
> ^C
>

Please add:

Fixes: 0b592b5a01be ("tools: bpftool: add map create command")

here. And submit this one for the bpf tree.

> Signed-off-by: Alban Crequy <alban@xxxxxxxxxx>

> diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
> index e0c650d91784..994a7e0d16fb 100644
> --- a/tools/bpf/bpftool/map.c
> +++ b/tools/bpf/bpftool/map.c
> @@ -1151,6 +1151,9 @@ static int do_create(int argc, char **argv)
> return -1;
> }
> NEXT_ARG();
> + } else {
> + p_err("unknown arg %s", *argv);
> + return -1;
> }
> }
>