]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: fix attempt to install a second rib from imported table entries
authorDon Slice <dslice@cumulusnetworks.com>
Fri, 21 Apr 2017 18:18:42 +0000 (11:18 -0700)
committerDon Slice <dslice@cumulusnetworks.com>
Wed, 26 Apr 2017 14:25:12 +0000 (14:25 +0000)
Problem reported by a customer with prefix imported by rdnbrd not being
successfully installed in the quagga rib.  Determined that this was due
to VRR resolving the same arp entry, causing two entries to be installed
in table 10.  When these were imported into the quagga rib, they came in
as two different rib entries from the same table/instance, which is not
permitted and caused them to be deleted.

Added logic to zebra_add_import_table_entry to do the same actions as
rib_add and delete the older rib entry if a new rib entry is received
which matches.

Manual testing successful and automated tests for redistribute neighbor
have the same passes and failures as the base.

Ticket: CM-15926
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by:

zebra/redistribute.c

index 9c7ef5f12c19a3a3fe73ff29afa4d5782aefe9b4..7c1494cc6aa862b239472211b11c9e7b5e663bdb 100644 (file)
@@ -495,6 +495,7 @@ int
 zebra_add_import_table_entry (struct route_node *rn, struct rib *rib, const char *rmap_name)
 {
   struct rib *newrib;
+  struct rib *same;
   struct prefix p;
   struct nexthop *nhop;
   union g_addr *gate;
@@ -512,6 +513,21 @@ zebra_add_import_table_entry (struct route_node *rn, struct rib *rib, const char
           p.prefixlen = rn->p.prefixlen;
           p.u.prefix4 = rn->p.u.prefix4;
 
+          RNODE_FOREACH_RIB (rn, same)
+            {
+              if (CHECK_FLAG (same->status, RIB_ENTRY_REMOVED))
+                continue;
+
+              if (same->type == rib->type && same->instance == rib->instance
+                  && same->table == rib->table
+                  && same->type != ZEBRA_ROUTE_CONNECT)
+                break;
+            }
+
+          if (same)
+            zebra_del_import_table_entry (rn, same);
+
+
           if (rib->nexthop_num == 1)
            {
              nhop = rib->nexthop;