From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1661C2C49 for ; Wed, 30 Mar 2016 15:02:27 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 30 Mar 2016 06:02:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,416,1455004800"; d="scan'208";a="944455954" Received: from sie-lab-214-036.ir.intel.com (HELO sie-lab-214-36.ir.intel.com) ([10.237.214.36]) by orsmga002.jf.intel.com with ESMTP; 30 Mar 2016 06:02:28 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: declan.doherty@intel.com, Pablo de Lara Date: Wed, 30 Mar 2016 14:02:26 +0100 Message-Id: <1459342950-52434-4-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1459342950-52434-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1459342950-52434-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 3/7] l2fwd-crypto: add missing string initialization 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: , X-List-Received-Date: Wed, 30 Mar 2016 13:02:28 -0000 When passing the preferred crypto device type in the command line parameters, the string (HW/SW/ANY) was not being saved, which is used for error information to the user. Fixes: 27cf2d1b18e1 ("examples/l2fwd-crypto: discover capabilities") Signed-off-by: Pablo de Lara --- examples/l2fwd-crypto/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index fd30826..1b0c229 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -968,8 +968,12 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options, { int retval; - if (strcmp(lgopts[option_index].name, "cdev_type") == 0) - return parse_cryptodev_type(&options->type, optarg); + if (strcmp(lgopts[option_index].name, "cdev_type") == 0) { + retval = parse_cryptodev_type(&options->type, optarg); + if (retval == 0) + strcpy(options->string_type, optarg); + return retval; + } else if (strcmp(lgopts[option_index].name, "chain") == 0) return parse_crypto_opt_chain(options, optarg); -- 2.5.5