Skip to content

Commit

Permalink
tools: bpftool: print only one error message on byte parsing failure
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Quentin Monnet authored and David S. Miller committed Oct 22, 2017
1 parent 9f60617 commit d9c0b48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/bpf/bpftool/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit d9c0b48

Please sign in to comment.