ip-address: Use correct max attribute value in print_vf_stats64()
Subsystems (2)
PATCH 1/1 ip-address: Use correct max attribute value in print_vf_stats64()
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 <[email protected]>
--- ip/ipaddress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ip/ipaddress.c +1 -1
@@ -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" );
Signature · 1 line
2.20.1
Quoted 4 lines · On Thu, 21 Feb 2019 19:37:51 +0100 Phil Sutter <[email protected]> wrote:
IFLA_VF_MAXis larger than the highest valid index in vf array.Fixes a1b99717c7cd7 ("Add displaying VF traffic statistics")Signed-off-by Phil Sutter <[email protected]>
Good catch. It worked because VF_MAX is 12 and VF_STATS_MAX is 8. Applied.