From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo de Lara Subject: [PATCH v2 3/8] l2fwd-crypto: add missing string initialization Date: Thu, 31 Mar 2016 10:01:54 +0100 Message-ID: <1459414919-44829-4-git-send-email-pablo.de.lara.guarch@intel.com> References: <1459342950-52434-1-git-send-email-pablo.de.lara.guarch@intel.com> <1459414919-44829-1-git-send-email-pablo.de.lara.guarch@intel.com> Cc: declan.doherty@intel.com, Pablo de Lara To: dev@dpdk.org Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id E37495424 for ; Thu, 31 Mar 2016 11:01:59 +0200 (CEST) In-Reply-To: <1459414919-44829-1-git-send-email-pablo.de.lara.guarch@intel.com> 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" 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