]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip: filter by group before printing
authorJean Thomas <jean.thomas@wifirst.fr>
Tue, 20 May 2025 14:02:48 +0000 (16:02 +0200)
committerDavid Ahern <dsahern@kernel.org>
Thu, 29 May 2025 01:57:54 +0000 (01:57 +0000)
commit94b015178b7d649777ee0f5cb139de9320fcc26a
tree2b4ade48fc9babaaa34ea277b97f6d37f7cf8a8f
parent63fc3703b025e4530f83add08f6ad3c14bf25c91
ip: filter by group before printing

Filter the output using the requested group, if necessary.

This avoids to print an empty JSON object for each existing item
not matching the group filter when the --json option is used.

Before:
$ ip --json address list group test
[{},{},{},{},{},{},{},{},{},{},{},{}]

After:
$ ip --json address list group test
[]

Signed-off-by: Jean Thomas <jean.thomas@wifirst.fr>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/ipaddress.c