summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2016-03-31 10:32:09 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-03-31 22:24:21 +0200
commit49f79e86480d917f54247996a23c709554cbd88a (patch)
tree6955220e63a7f08ac251f2e890ad2d3d0bf48f72 /examples
parenta33809891b4407ef1bfab665cc9d55031299bddf (diff)
downloaddpdk-49f79e86480d917f54247996a23c709554cbd88a.zip
dpdk-49f79e86480d917f54247996a23c709554cbd88a.tar.gz
dpdk-49f79e86480d917f54247996a23c709554cbd88a.tar.xz
examples/l2fwd-crypto: add missing string initialization
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 <pablo.de.lara.guarch@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/l2fwd-crypto/main.c8
1 files 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);