]> git.ipfire.org Git - thirdparty/iproute2.git/commit
bridge: Deduplicate print_range()
authorBenjamin Poirier <bpoirier@nvidia.com>
Mon, 11 Dec 2023 14:07:29 +0000 (09:07 -0500)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 22 Dec 2023 17:57:54 +0000 (09:57 -0800)
commit1d73bfc8ab290d60a23ea248ca85dacfd7cd0e2b
treea2d34d51d0b84343e5ae5f45ac772a657b7d57d1
parentdd4e1749a977503698e7f76e157815b5d852caf1
bridge: Deduplicate print_range()

The two implementations are now identical so keep only one instance and
move it to json_print.c where there are already a few other specialized
printing functions.

The string that's formatted in the "end" buffer is only needed when
outputting a range so move the snprintf() call within the condition.

The second argument's purpose is better conveyed by calling it "end" rather
than "id" so rename it.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Tested-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/vlan.c
bridge/vni.c
include/json_print.h
lib/json_print.c