From patchwork Tue Jul 28 18:32:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Qiu X-Patchwork-Id: 6644 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 19C44C4FC; Tue, 28 Jul 2015 20:32:24 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 527B8C4FA for ; Tue, 28 Jul 2015 20:32:23 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 28 Jul 2015 11:32:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,564,1432623600"; d="scan'208";a="771625544" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 28 Jul 2015 11:32:21 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t6SIWKPe023462; Wed, 29 Jul 2015 02:32:20 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t6SIWGSe010128; Wed, 29 Jul 2015 02:32:18 +0800 Received: (from dayuqiu@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t6SIWGN0010124; Wed, 29 Jul 2015 02:32:16 +0800 From: Michael Qiu To: dev@dpdk.org Date: Wed, 29 Jul 2015 02:32:15 +0800 Message-Id: <1438108335-10093-1-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] testpmd: Fix segment fault when port ID greater than 76 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In testpmd, when using "rx_vlan add 1 77", it will be a segment fault Because the port ID should be less than 32. Signed-off-by: Michael Qiu --- app/test-pmd/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 1d29146..cf2aa6e 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -388,7 +388,7 @@ port_id_is_invalid(portid_t port_id, enum print_warning warning) if (port_id == (portid_t)RTE_PORT_ALL) return 0; - if (ports[port_id].enabled) + if (port_id < RTE_MAX_ETHPORTS && ports[port_id].enabled) return 0; if (warning == ENABLED_WARN)