From patchwork Tue Oct 24 08:37:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bing Zhao X-Patchwork-Id: 30761 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 453921B75A; Tue, 24 Oct 2017 10:37:24 +0200 (CEST) Received: from m50-135.163.com (m50-135.163.com [123.125.50.135]) by dpdk.org (Postfix) with ESMTP id A61E71B756 for ; Tue, 24 Oct 2017 10:37:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=7qwVBpiGId/+jzUmPC gqUQz9hiWAuyhihQHyrW0LDXg=; b=kFJcpghhW0LlfpYjEe9TmcploXenCjfXiQ 8e3sOQCXs94enw5/plFaXU4SnD2VeXq7JPuaeL6o0nxH09rTJ9WRk75lUHKL731o 4L1D2m2zrNQB3FaBgxuB+g/m1sg/E7gr8+JagAnGaK8ljjMmSKnMsTzJkfP2unAh rd7FJY5Uw= Received: from SHL0405.hxtcorp.net (unknown [180.173.249.63]) by smtp5 (Coremail) with SMTP id D9GowABnE7y_++5ZmPyEAA--.3313S2; Tue, 24 Oct 2017 16:37:19 +0800 (CST) From: Bing Zhao To: keith.wiles@intel.com Cc: dev@dpdk.org, Bing Zhao , bing.zhao@hxt-semitech.com, jie2.liu@hxt-semitech.com, jia.he@hxt-semitech.com Date: Tue, 24 Oct 2017 16:37:18 +0800 Message-Id: <20171024083718.22624-1-ilovethull@163.com> X-Mailer: git-send-email 2.11.0.windows.1 X-CM-TRANSID: D9GowABnE7y_++5ZmPyEAA--.3313S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7JFW8WFykKr4kJr17Gw4Uurg_yoWkurc_Za 4I934DXw45Kr1xtr10kFW5CayI9wnxCFs0gwnxKw17J34UKrWkCr97J392vr1rXr4qqrWa krnxGrZY9w17CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbNtxPUUUUU== X-Originating-IP: [180.173.249.63] X-CM-SenderInfo: xlor4vhwkxzzi6rwjhhfrp/1tbiMgB7t1WBZIa2jwAAsx Subject: [dpdk-dev] [pktgen] [PATCH] Fix the protocol settings with the range command. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" A "%" is missing in the command line, so the parameter comparison always returns failure. And the local variable "what" points to the argv[4], it is incorrect for this command since the argc is 4 and the max should be argv[3]. Signed-off-by: bing.zhao@hxt-semitech.com Signed-off-by: jie2.liu@hxt-semitech.com Signed-off-by: jia.he@hxt-semitech.com --- app/cli-functions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/cli-functions.c b/app/cli-functions.c index 076b86e..5e58f9c 100644 --- a/app/cli-functions.c +++ b/app/cli-functions.c @@ -150,7 +150,7 @@ static struct cli_map range_map[] = { { 31, "range %P src ip "SMMI" %4" }, { 32, "range %P dst ip %4 %4 %4 %4" }, { 33, "range %P src ip %4 %4 %4 %4" }, - { 40, "range %P proto tcp|udp" }, + { 40, "range %P proto %|tcp|udp" }, { 50, "range %P dst port "SMMI" %d" }, { 51, "range %P src port "SMMI" %d" }, { 52, "range %P dst port %d %d %d %d" }, @@ -280,7 +280,7 @@ range_cmd(int argc, char **argv) break; case 40: foreach_port(portlist, - range_set_proto(info, what) ); + range_set_proto(info, argv[3]) ); break; case 50: foreach_port(portlist,