static struct hash *nhrp_vc_hash;
static struct list_head childlist_head[512];
-static unsigned int nhrp_vc_key(void *peer_data)
+static unsigned int nhrp_vc_key(const void *peer_data)
{
- struct nhrp_vc *vc = peer_data;
+ const struct nhrp_vc *vc = peer_data;
return jhash_2words(sockunion_hash(&vc->local.nbma),
sockunion_hash(&vc->remote.nbma), 0);
}
{
char buf[2][SU_ADDRSTRLEN];
struct child_sa *sa = NULL, *lsa;
- uint32_t child_hash = child_id % ZEBRA_NUM_OF(childlist_head);
+ uint32_t child_hash = child_id % array_size(childlist_head);
int abort_migration = 0;
list_for_each_entry(lsa, &childlist_head[child_hash], childlist_entry)
size_t i;
nhrp_vc_hash = hash_create(nhrp_vc_key, nhrp_vc_cmp, "NHRP VC hash");
- for (i = 0; i < ZEBRA_NUM_OF(childlist_head); i++)
+ for (i = 0; i < array_size(childlist_head); i++)
list_init(&childlist_head[i]);
}
struct child_sa *sa, *n;
size_t i;
- for (i = 0; i < ZEBRA_NUM_OF(childlist_head); i++) {
+ for (i = 0; i < array_size(childlist_head); i++) {
list_for_each_entry_safe(sa, n, &childlist_head[i],
childlist_entry)
nhrp_vc_ipsec_updown(sa->id, 0);