The ip neigh command supports --json for "list" but not for "get". Add
json support for the "get" command so that it's possible to fetch
information about specific neighbors without regular expressions.
Fixes: aac7f725fa46 ("ipneigh: add color and json support")
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
return -2;
ipneigh_reset_filter(0);
+ new_json_obj(json);
if (print_neigh(answer, stdout) < 0) {
fprintf(stderr, "An error :-)\n");
free(answer);
+ delete_json_obj();
return -1;
}
free(answer);
+ delete_json_obj();
return 0;
}