summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2016-03-31 10:32:10 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-03-31 22:24:21 +0200
commita158899a8063cafb6709373a6ebcd66aa019f756 (patch)
tree98398b4aa82d7a0c20531c542bddc184bebf2046 /examples
parent49f79e86480d917f54247996a23c709554cbd88a (diff)
downloaddpdk-a158899a8063cafb6709373a6ebcd66aa019f756.zip
dpdk-a158899a8063cafb6709373a6ebcd66aa019f756.tar.gz
dpdk-a158899a8063cafb6709373a6ebcd66aa019f756.tar.xz
examples/l2fwd-crypto: fix length of random IV/AAD
App was generating a random IV/AAD of only 4 bytes, instead of the actual length, since it was using sizeof(length). Fixes: 27cf2d1b18e1 ("examples/l2fwd-crypto: discover capabilities") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Tested-by: Min Cao <min.cao@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/l2fwd-crypto/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 1b0c229..c323b55 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -643,7 +643,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
port_cparams[i].aad.phys_addr = options->aad.phys_addr;
if (!options->aad_param)
generate_random_key(port_cparams[i].aad.data,
- sizeof(port_cparams[i].aad.length));
+ port_cparams[i].aad.length);
}
@@ -661,7 +661,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
port_cparams[i].iv.phys_addr = options->iv.phys_addr;
if (!options->iv_param)
generate_random_key(port_cparams[i].iv.data,
- sizeof(port_cparams[i].iv.length));
+ port_cparams[i].iv.length);
port_cparams[i].cipher_algo = options->cipher_xform.cipher.algo;
}