mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 12:36:20 +00:00
ospfd: Fix conflict router-id, memory leaks
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>
This commit is contained in:
parent
825d5fbf59
commit
97a69b318c
@ -269,7 +269,8 @@ void ospf_nbr_add_self(struct ospf_interface *oi, struct in_addr router_id)
|
|||||||
rn = route_node_get(oi->nbrs, &p);
|
rn = route_node_get(oi->nbrs, &p);
|
||||||
if (rn->info) {
|
if (rn->info) {
|
||||||
/* There is already pseudo neighbor. */
|
/* 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);
|
route_unlock_node(rn);
|
||||||
} else
|
} else
|
||||||
rn->info = oi->nbr_self;
|
rn->info = oi->nbr_self;
|
||||||
|
@ -401,6 +401,8 @@ static void ospf_spf_flush_parents(struct vertex *w)
|
|||||||
/* delete the existing nexthops */
|
/* delete the existing nexthops */
|
||||||
for (ALL_LIST_ELEMENTS(w->parents, ln, nn, vp)) {
|
for (ALL_LIST_ELEMENTS(w->parents, ln, nn, vp)) {
|
||||||
list_delete_node(w->parents, ln);
|
list_delete_node(w->parents, ln);
|
||||||
|
if (vp->nexthop)
|
||||||
|
vertex_nexthop_free(vp->nexthop);
|
||||||
vertex_parent_free(vp);
|
vertex_parent_free(vp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -715,6 +715,7 @@ void ospf_redist_del(struct ospf *ospf, u_char type, u_short instance)
|
|||||||
list_free(ospf->redist[type]);
|
list_free(ospf->redist[type]);
|
||||||
ospf->redist[type] = NULL;
|
ospf->redist[type] = NULL;
|
||||||
}
|
}
|
||||||
|
ospf_routemap_unset(red);
|
||||||
XFREE(MTYPE_OSPF_REDISTRIBUTE, red);
|
XFREE(MTYPE_OSPF_REDISTRIBUTE, red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1187,7 +1187,7 @@ void ospf_ls_upd_queue_empty(struct ospf_interface *oi)
|
|||||||
if ((lst = (struct list *)rn->info)) {
|
if ((lst = (struct list *)rn->info)) {
|
||||||
for (ALL_LIST_ELEMENTS(lst, node, nnode, lsa))
|
for (ALL_LIST_ELEMENTS(lst, node, nnode, lsa))
|
||||||
ospf_lsa_unlock(&lsa); /* oi->ls_upd_queue */
|
ospf_lsa_unlock(&lsa); /* oi->ls_upd_queue */
|
||||||
list_free(lst);
|
list_delete(lst);
|
||||||
rn->info = NULL;
|
rn->info = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user