]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: resolve assert when adding ip import-table entry
authorDon Slice <dslice@cumulusnetworks.com>
Sun, 15 Apr 2018 19:25:24 +0000 (12:25 -0700)
committerDon Slice <dslice@cumulusnetworks.com>
Mon, 16 Apr 2018 13:09:29 +0000 (06:09 -0700)
Problem was due to in certain route replace circumstances,
we would mark the old route_entry as removed to delete it but
would leave the selected flag set.  When the rn was pulled off the
work queue for process, we would find both the new re and old re
(being deleted) with the selected flag set and would assert.
In this change, when we decide to delete the old re, we also  mark
it as no longer selected.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
zebra/redistribute.c

index 15e7d4437a73d777c6c8454d0b1377c5f4d98d04..6a7a75f209b5cd897594c8bfff7f5a7086305664 100644 (file)
@@ -531,6 +531,7 @@ int zebra_add_import_table_entry(struct route_node *rn, struct route_entry *re,
                        re->tag, rmap_name);
 
        if (ret != RMAP_MATCH) {
+               UNSET_FLAG(same->flags, ZEBRA_FLAG_SELECTED);
                zebra_del_import_table_entry(rn, re);
                return 0;
        }
@@ -547,8 +548,10 @@ int zebra_add_import_table_entry(struct route_node *rn, struct route_entry *re,
                        break;
        }
 
-       if (same)
+       if (same) {
+               UNSET_FLAG(same->flags, ZEBRA_FLAG_SELECTED);
                zebra_del_import_table_entry(rn, same);
+       }
 
        newre = XCALLOC(MTYPE_RE, sizeof(struct route_entry));
        newre->type = ZEBRA_ROUTE_TABLE;