From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F3A1A046B for ; Mon, 22 Jul 2019 18:58:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3CDE1BF3F; Mon, 22 Jul 2019 18:58:38 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3298E1BF35 for ; Mon, 22 Jul 2019 18:58:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2019 09:58:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,295,1559545200"; d="scan'208";a="177039404" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.223.78]) by FMSMGA003.fm.intel.com with ESMTP; 22 Jul 2019 09:58:34 -0700 From: Ferruh Yigit To: Adrien Mazarguil , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Cc: dev@dpdk.org, Raslan Darawsheh , Stephen Hemminger Date: Mon, 22 Jul 2019 17:58:32 +0100 Message-Id: <20190722165832.38054-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] app/testpmd: fix MAC addr parser for flow 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" MAC address parsing was causing failure [1], this patch partially reverts the commit commit b5ddce8959b2 ("app/testpmd: use new ethernet address parser") [1] testpmd> flow validate 0 priority 2 ingress group 0 pattern eth dst is 98:03:9B:5C:D9:00 / end actions queue index 0 / end Bad arguments Fixes: b5ddce8959b2 ("app/testpmd: use new ethernet address parser") Reported-by: Raslan Darawsheh Signed-off-by: Ferruh Yigit --- Cc: Stephen Hemminger --- app/test-pmd/cmdline_flow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index d08f016be..495871394 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "testpmd.h" @@ -4978,8 +4979,8 @@ parse_mac_addr(struct context *ctx, const struct token *token, /* Only network endian is supported. */ if (!arg->hton) goto error; - ret = rte_ether_unformat_addr(str, &tmp); - if (ret < 0) + ret = cmdline_parse_etheraddr(NULL, str, &tmp, size); + if (ret < 0 || (unsigned int)ret != len) goto error; if (!ctx->object) return len; -- 2.21.0