]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #957 from chiragshah6/mdev
authorDavid Lamparter <equinox@diac24.net>
Fri, 11 Aug 2017 16:28:04 +0000 (18:28 +0200)
committerGitHub <noreply@github.com>
Fri, 11 Aug 2017 16:28:04 +0000 (18:28 +0200)
ospfd: fix crash due to conflicting router-id, fix MI-OSPF cli in lib commands and fix memory leaks

lib/command.c
ospfd/ospf_neighbor.c
ospfd/ospf_spf.c
ospfd/ospf_zebra.c
ospfd/ospfd.c

index 077a72398ded9333ed8afcfde3cb9763aaddbd83..45b5593a3e8c675c5368c1b102e6a8978559964b 100644 (file)
@@ -1062,7 +1062,8 @@ int cmd_execute_command(vector vline, struct vty *vty,
        if (vtysh)
                return saved_ret;
 
-       if (ret != CMD_SUCCESS && ret != CMD_WARNING) {
+       if (ret != CMD_SUCCESS && ret != CMD_WARNING
+           && ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED) {
                /* This assumes all nodes above CONFIG_NODE are childs of
                 * CONFIG_NODE */
                while (vty->node > CONFIG_NODE) {
@@ -1070,7 +1071,9 @@ int cmd_execute_command(vector vline, struct vty *vty,
                        vty->node = try_node;
                        ret = cmd_execute_command_real(vline, FILTER_RELAXED,
                                                       vty, cmd);
-                       if (ret == CMD_SUCCESS || ret == CMD_WARNING)
+                       if (ret == CMD_SUCCESS || ret == CMD_WARNING
+                           || ret == CMD_NOT_MY_INSTANCE
+                           || ret == CMD_WARNING_CONFIG_FAILED)
                                return ret;
                }
                /* no command succeeded, reset the vty to the original node */
@@ -1134,6 +1137,8 @@ int command_config_read_one_line(struct vty *vty,
        if (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
            && !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
            && ret != CMD_SUCCESS && ret != CMD_WARNING
+           && ret != CMD_NOT_MY_INSTANCE
+           && ret != CMD_WARNING_CONFIG_FAILED
            && vty->node != CONFIG_NODE) {
 
                saved_node = vty->node;
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;
                }