mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-15 14:05:22 +08:00
ip neigh: Support --json on ip neigh get
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: aac7f725fa
("ipneigh: add color and json support")
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
parent
a4442ce58e
commit
94fc813b85
@ -729,12 +729,15 @@ static int ipneigh_get(int argc, char **argv)
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user