Message ID | 20171019224626.31608-6-jakub.kicinski@netronome.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
Series | tools: bpftool: add a "version" command, and fix several items | expand |
On 10/20/2017 12:46 AM, Jakub Kicinski wrote: > From: Quentin Monnet <quentin.monnet@netronome.com> > > Make error messages more consistent. Specifically, when bpftool fails at > parsing map key bytes, make it print a single error message to stderr > and return from the function, instead of (always) printing a second > error message afterwards. > > Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> > Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index b1dad76215ed..e1004d825392 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -252,7 +252,7 @@ static char **parse_bytes(char **argv, const char *name, unsigned char *val, val[i] = strtoul(argv[i], &endptr, 0); if (*endptr) { err("error parsing byte: %s\n", argv[i]); - break; + return NULL; } i++; }