X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fipsec%2Fipsec_sa.c;h=515eb25d3238b4f18881742eb3e9769aa78b2d51;hb=490b92738;hp=71e86ac5c4511e7bd4180b3bca9440731076fb3a;hpb=041add7d12217494934b651e4e38b5eab5216ddc;p=vpp.git diff --git a/src/vnet/ipsec/ipsec_sa.c b/src/vnet/ipsec/ipsec_sa.c index 71e86ac5c45..515eb25d323 100644 --- a/src/vnet/ipsec/ipsec_sa.c +++ b/src/vnet/ipsec/ipsec_sa.c @@ -108,8 +108,13 @@ ipsec_sa_set_crypto_alg (ipsec_sa_t * sa, ipsec_crypto_alg_t crypto_alg) if (IPSEC_CRYPTO_ALG_IS_GCM (crypto_alg)) { sa->integ_icv_size = im->crypto_algs[crypto_alg].icv_size; + ipsec_sa_set_IS_CTR (sa); ipsec_sa_set_IS_AEAD (sa); } + else if (IPSEC_CRYPTO_ALG_IS_CTR (crypto_alg)) + { + ipsec_sa_set_IS_CTR (sa); + } } void @@ -211,8 +216,7 @@ ipsec_sa_add_and_lock (u32 id, sa->tunnel_flags = tunnel_flags; sa->dscp = dscp; sa->salt = salt; - sa->encrypt_thread_index = (vlib_num_workers ())? ~0 : 0; - sa->decrypt_thread_index = (vlib_num_workers ())? ~0 : 0; + sa->thread_index = (vlib_num_workers ()) ? ~0 : 0; if (integ_alg != IPSEC_INTEG_ALG_NONE) { ipsec_sa_set_integ_alg (sa, integ_alg); @@ -460,11 +464,11 @@ ipsec_sa_walk (ipsec_sa_walk_cb_t cb, void *ctx) ipsec_sa_t *sa; /* *INDENT-OFF* */ - pool_foreach (sa, im->sad, - ({ + pool_foreach (sa, im->sad) + { if (WALK_CONTINUE != cb(sa, ctx)) break; - })); + } /* *INDENT-ON* */ }