Remove assert in path of router_id_update:
Upon configuring same router-id as neighbor's
assert would cause a crash. Log a warning message
and neighborship would not come up.
Address memory leaks
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
rn = route_node_get(oi->nbrs, &p);
if (rn->info) {
/* There is already pseudo neighbor. */
- assert(oi->nbr_self == rn->info);
+ zlog_warn("router_id %s already present in neighbor table. node refcount %u",
+ inet_ntoa(router_id), rn->lock);
route_unlock_node(rn);
} else
rn->info = oi->nbr_self;
/* delete the existing nexthops */
for (ALL_LIST_ELEMENTS(w->parents, ln, nn, vp)) {
list_delete_node(w->parents, ln);
+ if (vp->nexthop)
+ vertex_nexthop_free(vp->nexthop);
vertex_parent_free(vp);
}
}
list_free(ospf->redist[type]);
ospf->redist[type] = NULL;
}
+ ospf_routemap_unset(red);
XFREE(MTYPE_OSPF_REDISTRIBUTE, red);
}
}
if ((lst = (struct list *)rn->info)) {
for (ALL_LIST_ELEMENTS(lst, node, nnode, lsa))
ospf_lsa_unlock(&lsa); /* oi->ls_upd_queue */
- list_free(lst);
+ list_delete(lst);
rn->info = NULL;
}