netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iproute2 PATCH] bridge: fix vlan show stats formatting
@ 2018-10-20 13:42 Tobias Jungel
  2018-10-22 16:47 ` Stephen Hemminger
  2018-10-22 17:00 ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Tobias Jungel @ 2018-10-20 13:42 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

The output of -statistics vlan show was broken previous change for json
output. This aligns the format to vlan show.

Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>
---
 bridge/vlan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/bridge/vlan.c b/bridge/vlan.c
index bdce55ae..85f4a539 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -487,8 +487,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex)
 	list = brtb[LINK_XSTATS_TYPE_BRIDGE];
 	rem = RTA_PAYLOAD(list);

-	ifname = ll_index_to_name(ifindex);
-	open_json_object(ifname);
+	open_vlan_port(ifindex);

 	print_color_string(PRINT_FP, COLOR_IFNAME,
 			   NULL, "%-16s", ifname);
@@ -509,8 +508,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex)

 		print_one_vlan_stats(vstats);
 	}
-	close_json_object();
-
+	close_vlan_port();
 }

 static int print_vlan_stats(const struct sockaddr_nl *who,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [iproute2 PATCH] bridge: fix vlan show stats formatting
  2018-10-20 13:42 [iproute2 PATCH] bridge: fix vlan show stats formatting Tobias Jungel
@ 2018-10-22 16:47 ` Stephen Hemminger
  2018-10-22 17:00 ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2018-10-22 16:47 UTC (permalink / raw)
  To: Tobias Jungel; +Cc: netdev

On Sat, 20 Oct 2018 15:42:33 +0200
Tobias Jungel <tobias.jungel@gmail.com> wrote:

> The output of -statistics vlan show was broken previous change for json
> output. This aligns the format to vlan show.
> 
> Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [iproute2 PATCH] bridge: fix vlan show stats formatting
  2018-10-20 13:42 [iproute2 PATCH] bridge: fix vlan show stats formatting Tobias Jungel
  2018-10-22 16:47 ` Stephen Hemminger
@ 2018-10-22 17:00 ` Stephen Hemminger
  2018-10-26 21:51   ` [iproute2 PATCH v2] " Tobias Jungel
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2018-10-22 17:00 UTC (permalink / raw)
  To: Tobias Jungel; +Cc: netdev

On Sat, 20 Oct 2018 15:42:33 +0200
Tobias Jungel <tobias.jungel@gmail.com> wrote:

> The output of -statistics vlan show was broken previous change for json
> output. This aligns the format to vlan show.
> 
> Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>

This patch causes new warning:
    CC       vlan.o
vlan.c: In function ‘print_vlan_stats_attr’:
vlan.c:492:2: warning: ‘ifname’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  print_color_string(PRINT_FP, COLOR_IFNAME,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       NULL, "%-16s", ifname);
       ~~~~~~~~~~~~~~~~~~~~~~


Reverting the patch, please fix and resubmit.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [iproute2 PATCH v2] bridge: fix vlan show stats formatting
  2018-10-22 17:00 ` Stephen Hemminger
@ 2018-10-26 21:51   ` Tobias Jungel
  2018-10-29 16:58     ` Stephen Hemminger
  0 siblings, 1 reply; 5+ messages in thread
From: Tobias Jungel @ 2018-10-26 21:51 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

The output of -statistics vlan show was broken previous change for json
output. This aligns the format to vlan show.

v2: fixed too greedy deletion that caused a -Wmaybe-uninitialized

Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>
---
 bridge/vlan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bridge/vlan.c b/bridge/vlan.c
index a111d5e6..d075a42d 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -484,7 +484,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex)
 	rem = RTA_PAYLOAD(list);

 	ifname = ll_index_to_name(ifindex);
-	open_json_object(ifname);
+	open_vlan_port(ifindex);

 	print_color_string(PRINT_FP, COLOR_IFNAME,
 			   NULL, "%-16s", ifname);
@@ -505,8 +505,7 @@ static void print_vlan_stats_attr(struct rtattr *attr, int ifindex)

 		print_one_vlan_stats(vstats);
 	}
-	close_json_object();
-
+	close_vlan_port();
 }

 static int print_vlan_stats(struct nlmsghdr *n, void *arg)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [iproute2 PATCH v2] bridge: fix vlan show stats formatting
  2018-10-26 21:51   ` [iproute2 PATCH v2] " Tobias Jungel
@ 2018-10-29 16:58     ` Stephen Hemminger
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2018-10-29 16:58 UTC (permalink / raw)
  To: Tobias Jungel; +Cc: netdev

On Fri, 26 Oct 2018 23:51:03 +0200
Tobias Jungel <tobias.jungel@bisdn.de> wrote:

> The output of -statistics vlan show was broken previous change for json
> output. This aligns the format to vlan show.
> 
> v2: fixed too greedy deletion that caused a -Wmaybe-uninitialized
> 
> Signed-off-by: Tobias Jungel <tobias.jungel@gmail.com>

Applied

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-30  1:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-20 13:42 [iproute2 PATCH] bridge: fix vlan show stats formatting Tobias Jungel
2018-10-22 16:47 ` Stephen Hemminger
2018-10-22 17:00 ` Stephen Hemminger
2018-10-26 21:51   ` [iproute2 PATCH v2] " Tobias Jungel
2018-10-29 16:58     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).