ipsec: Checking wrong DB for initialistation
Type: fix
@@ -263,7 +263,7 @@ ipsec_tun_protect_rx_db_add (ipsec_main_t * im,
ipsec4_tunnel_mk_key(&key, &itp->itp_crypto.dst.ip4,
clib_host_to_net_u32 (sa->spi));
- if (!im->tun4_protect_by_key.nbuckets)
+ if (!clib_bihash_is_initialised_8_16 (&im->tun4_protect_by_key))
clib_bihash_init_8_16 (&im->tun4_protect_by_key,
"IPSec IPv4 tunnels",
IPSEC_TUN_DEFAULT_HASH_NUM_BUCKETS,
@@ -283,7 +283,7 @@ ipsec_tun_protect_rx_db_add (ipsec_main_t * im,
};
clib_bihash_kv_24_16_t *bkey = (clib_bihash_kv_24_16_t*)&key;
- if (!im->tun4_protect_by_key.nbuckets)
+ if (!clib_bihash_is_initialised_24_16 (&im->tun6_protect_by_key))
clib_bihash_init_24_16 (&im->tun6_protect_by_key,
"IPSec IPv6 tunnels",
IPSEC_TUN_DEFAULT_HASH_NUM_BUCKETS,
