]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Fix conflict router-id, memory leaks 957/head
authorChirag Shah <chirag@cumulusnetworks.com>
Fri, 23 Jun 2017 00:19:00 +0000 (17:19 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Thu, 10 Aug 2017 22:12:19 +0000 (15:12 -0700)
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>
ospfd/ospf_neighbor.c
ospfd/ospf_spf.c
ospfd/ospf_zebra.c
ospfd/ospfd.c

index 33492cf7c9b91585acf4f9148c9138f75f51b25e..a7aac26b3b6e6aa45ed65b9bc8d87ae48ff3552d 100644 (file)
@@ -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);
        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;
index c520a31266978f8bbd942d08581cbf26f3843dec..7437d26da31e40bb86781e37b1a158affbb5d66b 100644 (file)
@@ -401,6 +401,8 @@ static void ospf_spf_flush_parents(struct vertex *w)
        /* 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);
        }
 }
index ec8f1ee8524e6057511bf3c3e36c05daa77ecdac..d615afc0727a7b8f498f2c099b0f97fbac9ff0e5 100644 (file)
@@ -715,6 +715,7 @@ void ospf_redist_del(struct ospf *ospf, u_char type, u_short instance)
                        list_free(ospf->redist[type]);
                        ospf->redist[type] = NULL;
                }
+               ospf_routemap_unset(red);
                XFREE(MTYPE_OSPF_REDISTRIBUTE, red);
        }
 }
index b3553238efddda71881e56f2c333d06f6043de7a..20cee713bddd78e8c914a13833055bb9ff821342 100644 (file)
@@ -1187,7 +1187,7 @@ void ospf_ls_upd_queue_empty(struct ospf_interface *oi)
                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;
                }