Message ID | 1517238014-22220-4-git-send-email-odpbot@yandex.ru |
---|---|
State | New |
Headers | show |
Series | [v2,1/5] linux-gen: ipsec: disallow using SAs while they are being created | expand |
diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 162626de0..ad229e754 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -575,9 +575,10 @@ ipsec_sa_t *_odp_ipsec_sa_lookup(const ipsec_sa_lookup_t *lookup) if (NULL != best) _odp_ipsec_sa_unuse(best); return ipsec_sa; - } else if (ODP_IPSEC_LOOKUP_SPI == ipsec_sa->in.lookup_mode && - lookup->proto == ipsec_sa->proto && - lookup->spi == ipsec_sa->spi) { + } else if (NULL == best && + ODP_IPSEC_LOOKUP_SPI == ipsec_sa->in.lookup_mode && + lookup->proto == ipsec_sa->proto && + lookup->spi == ipsec_sa->spi) { best = ipsec_sa; } else { _odp_ipsec_sa_unuse(ipsec_sa);