From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA01BC43381 for ; Thu, 21 Feb 2019 18:37:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85EBE2081B for ; Thu, 21 Feb 2019 18:37:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728153AbfBUShq (ORCPT ); Thu, 21 Feb 2019 13:37:46 -0500 Received: from orbyte.nwl.cc ([151.80.46.58]:60322 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726075AbfBUShp (ORCPT ); Thu, 21 Feb 2019 13:37:45 -0500 Received: from localhost ([::1]:45180 helo=tatos) by orbyte.nwl.cc with esmtp (Exim 4.91) (envelope-from ) id 1gwtE7-0007Mh-Jl; Thu, 21 Feb 2019 19:37:43 +0100 From: Phil Sutter To: Stephen Hemminger Cc: netdev@vger.kernel.org Subject: [iproute PATCH] ip-address: Use correct max attribute value in print_vf_stats64() Date: Thu, 21 Feb 2019 19:37:51 +0100 Message-Id: <20190221183751.10604-1-phil@nwl.cc> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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