All of lore.kernel.org
 help / color / mirror / Atom feed
* [iproute PATCH] ip-address: Use correct max attribute value in print_vf_stats64()
@ 2019-02-21 18:37 Phil Sutter
  2019-02-21 22:40 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2019-02-21 18:37 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

IFLA_VF_MAX is larger than the highest valid index in vf array.

Fixes: a1b99717c7cd7 ("Add displaying VF traffic statistics")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 ip/ipaddress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index bc30d326ca0a3..139afe9d572e6 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -547,7 +547,7 @@ static void print_vf_stats64(FILE *fp, struct rtattr *vfstats)
 		return;
 	}
 
-	parse_rtattr_nested(vf, IFLA_VF_MAX, vfstats);
+	parse_rtattr_nested(vf, IFLA_VF_STATS_MAX, vfstats);
 
 	if (is_json_context()) {
 		open_json_object("stats");
-- 
2.20.1


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

* Re: [iproute PATCH] ip-address: Use correct max attribute value in print_vf_stats64()
  2019-02-21 18:37 [iproute PATCH] ip-address: Use correct max attribute value in print_vf_stats64() Phil Sutter
@ 2019-02-21 22:40 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2019-02-21 22:40 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netdev

On Thu, 21 Feb 2019 19:37:51 +0100
Phil Sutter <phil@nwl.cc> wrote:

> IFLA_VF_MAX is larger than the highest valid index in vf array.
> 
> Fixes: a1b99717c7cd7 ("Add displaying VF traffic statistics")
> Signed-off-by: Phil Sutter <phil@nwl.cc>

Good catch. It worked because VF_MAX is 12 and VF_STATS_MAX is 8.
Applied.


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

end of thread, other threads:[~2019-02-21 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 18:37 [iproute PATCH] ip-address: Use correct max attribute value in print_vf_stats64() Phil Sutter
2019-02-21 22:40 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.