aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2017-10-18 12:21:34 +0200
committerDave Barach <openvpp@barachs.net>2017-10-18 12:55:00 +0000
commitec46b7c60ee22fdb836a4b2bcf97153c632173d2 (patch)
treeb070ca94920394fc33c0128dfcadcee37a1eed4b /src/plugins
parentcf5e848d69a4f14464c1e2d56896bc9f7e586951 (diff)
ipsec: use boolean or vs. bitwise or to avoid compiler error
Ubuntu 17.04, gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2), "make build" fails with the few of the errors below: error: suggest parentheses around comparison in operand of ‘|’ [-Werror=parentheses] is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 | Solution: use the logical rather than the bitwise or. Change-Id: Iffcc1ed2e68b14b248159cb117593d32c623c553 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dpdk/ipsec/esp_decrypt.c8
-rw-r--r--src/plugins/dpdk/ipsec/ipsec.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/dpdk/ipsec/esp_decrypt.c b/src/plugins/dpdk/ipsec/esp_decrypt.c
index 9405f18ee76..6de1f004347 100644
--- a/src/plugins/dpdk/ipsec/esp_decrypt.c
+++ b/src/plugins/dpdk/ipsec/esp_decrypt.c
@@ -171,8 +171,8 @@ dpdk_esp_decrypt_node_fn (vlib_main_t * vm,
auth_alg = vec_elt_at_index (dcm->auth_algs, sa0->integ_alg);
#if DPDK_NO_AEAD
- is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 |
- sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 |
+ is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 ||
+ sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 ||
sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256);
#else
is_aead = (cipher_alg->type == RTE_CRYPTO_SYM_XFORM_AEAD);
@@ -470,8 +470,8 @@ dpdk_esp_decrypt_post_node_fn (vlib_main_t * vm,
cipher_alg = vec_elt_at_index (dcm->cipher_algs, sa0->crypto_alg);
auth_alg = vec_elt_at_index (dcm->auth_algs, sa0->integ_alg);
#if DPDK_NO_AEAD
- is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 |
- sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 |
+ is_aead = (sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 ||
+ sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 ||
sa0->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256);
#else
is_aead = cipher_alg->type == RTE_CRYPTO_SYM_XFORM_AEAD;
diff --git a/src/plugins/dpdk/ipsec/ipsec.c b/src/plugins/dpdk/ipsec/ipsec.c
index 2fd331c1ccd..4bae8c1b0f4 100644
--- a/src/plugins/dpdk/ipsec/ipsec.c
+++ b/src/plugins/dpdk/ipsec/ipsec.c
@@ -317,8 +317,8 @@ crypto_set_auth_xform (struct rte_crypto_sym_xform *xform,
xform->auth.key.length = a->key_len;
xform->auth.digest_length = a->trunc_size;
#if DPDK_NO_AEAD
- if (sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 |
- sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 |
+ if (sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_128 ||
+ sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_192 ||
sa->crypto_alg == IPSEC_CRYPTO_ALG_AES_GCM_256)
xform->auth.algo = RTE_CRYPTO_AUTH_AES_GCM;
xform->auth.add_auth_data_length = sa->use_esn ? 12 : 8;