ipsec: fix assert condition
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Mon, 14 Jan 2019 12:07:39 +0000 (12:07 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 14 Jan 2019 13:45:02 +0000 (14:45 +0100)
fix invalid RTE_ASSERT condition in rsn_update_finish()

Fixes: c0308cd89554 ("ipsec: rework SA replay window/SQN for MT environment")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_ipsec/ipsec_sqn.h

index 7de10be..a3ae7e2 100644 (file)
@@ -333,7 +333,7 @@ rsn_update_finish(struct rte_ipsec_sa *sa, struct replay_sqn *rsn)
 
        n = sa->sqn.inb.wridx;
        RTE_ASSERT(n != sa->sqn.inb.rdidx);
-       RTE_ASSERT(rsn - sa->sqn.inb.rsn == n);
+       RTE_ASSERT(rsn == sa->sqn.inb.rsn[n]);
 
        rte_rwlock_write_unlock(&rsn->rwl);
        sa->sqn.inb.rdidx = n;