- if (!im->tun4_protect_by_key.nbuckets)
- clib_bihash_init_24_16 (&im->tun6_protect_by_key,
- "IPSec IPv6 tunnels",
- IPSEC_TUN_DEFAULT_HASH_NUM_BUCKETS,
- IPSEC_TUN_DEFAULT_HASH_MEMORY_SIZE);
- clib_bihash_add_del_24_16 (&im->tun6_protect_by_key, bkey, 1);
- ipsec_tun_register_nodes(AF_IP6);
- }
+ 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,
+ IPSEC_TUN_DEFAULT_HASH_MEMORY_SIZE);
+ clib_bihash_add_del_24_16 (&im->tun6_protect_by_key, bkey, 1);
+ ipsec_tun_register_nodes (AF_IP6);
+ }