diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h index a83fd2283bf..1fe6b97168d 100644 --- a/examples/ipsec-secgw/ipsec.h +++ b/examples/ipsec-secgw/ipsec.h @@ -117,7 +117,7 @@ struct __rte_cache_aligned ipsec_sa { uint32_t spi; struct cdev_qp *cqp[RTE_MAX_LCORE]; uint64_t seq; - uint32_t salt; + rte_be32_t salt; uint32_t fallback_sessions; enum rte_crypto_cipher_algorithm cipher_algo; enum rte_crypto_auth_algorithm auth_algo; diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 8aa9aca739a..c4bac17cd77 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -374,7 +374,6 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, uint32_t ti; /*token index*/ uint32_t *ri /*rule index*/; struct ipsec_sa_cnt *sa_cnt; - rte_be32_t salt; /*big-endian salt*/ uint32_t cipher_algo_p = 0; uint32_t auth_algo_p = 0; uint32_t aead_algo_p = 0; @@ -509,8 +508,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, if (algo->algo == RTE_CRYPTO_CIPHER_AES_CTR) { key_len -= 4; rule->cipher_key_len = key_len; - memcpy(&salt, &rule->cipher_key[key_len], 4); - rule->salt = rte_be_to_cpu_32(salt); + memcpy(&rule->salt, + &rule->cipher_key[key_len], 4); } cipher_algo_p = 1; @@ -574,8 +573,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, key_len -= 4; rule->auth_key_len = key_len; rule->iv_len = algo->iv_len; - memcpy(&salt, &rule->auth_key[key_len], 4); - rule->salt = rte_be_to_cpu_32(salt); + memcpy(&rule->salt, + &rule->auth_key[key_len], 4); } auth_algo_p = 1; @@ -633,8 +632,8 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, key_len -= 4; rule->cipher_key_len = key_len; - memcpy(&salt, &rule->cipher_key[key_len], 4); - rule->salt = rte_be_to_cpu_32(salt); + memcpy(&rule->salt, + &rule->cipher_key[key_len], 4); aead_algo_p = 1; continue;