From patchwork Fri Jun 24 16:36:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pattan, Reshma" X-Patchwork-Id: 14373 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 009C9C69C; Fri, 24 Jun 2016 18:36:34 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BD0F7C5C8 for ; Fri, 24 Jun 2016 18:36:27 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 24 Jun 2016 09:36:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,521,1459839600"; d="scan'208";a="128001389" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 24 Jun 2016 09:36:26 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u5OGaPfl022375; Fri, 24 Jun 2016 17:36:25 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u5OGaPub003965; Fri, 24 Jun 2016 17:36:25 +0100 Received: (from reshmapa@localhost) by sivswdev02.ir.intel.com with id u5OGaPrF003957; Fri, 24 Jun 2016 17:36:25 +0100 From: Reshma Pattan To: dev@dpdk.org Cc: Reshma Pattan Date: Fri, 24 Jun 2016 17:36:23 +0100 Message-Id: <1466786183-3772-6-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1466786183-3772-1-git-send-email-reshma.pattan@intel.com> References: <1466776473-30883-1-git-send-email-reshma.pattan@intel.com> <1466786183-3772-1-git-send-email-reshma.pattan@intel.com> Subject: [dpdk-dev] [PATCH v5 5/5] app/pdump: fix type casting of ring size 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" ring_size value is wrongly type casted to uint16_t. It should be type casted to uint32_t, as maximum ring size is 28bit long. Wrong type cast wrapping around the ring size values bigger than 65535. Fixes: caa7028276b8 ("app/pdump: add tool for packet capturing") Signed-off-by: Reshma Pattan Acked-by: John McNamara --- app/pdump/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index fe4d38a..2087c15 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -362,7 +362,7 @@ parse_pdump(const char *optarg) &parse_uint_value, &v); if (ret < 0) goto free_kvlist; - pt->ring_size = (uint16_t) v.val; + pt->ring_size = (uint32_t) v.val; } else pt->ring_size = RING_SIZE;