]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: resolve issue with protocol route-map not applied properly 4209/head
authorDon Slice <dslice@cumulusnetworks.com>
Wed, 24 Apr 2019 17:14:57 +0000 (17:14 +0000)
committerDon Slice <dslice@cumulusnetworks.com>
Fri, 26 Apr 2019 17:15:44 +0000 (17:15 +0000)
Problem reported that route-maps applied to "ip protocol table bgp"
would not be invoked if the ip protocol table command was issued
after the bgp prefixes were installed.  Found that a recent change
improving how often nexthop_active_update runs missed causing this
filtering to be applied. This fix resolves that issue as well as
a couple of other places that were problematic with the recent
change.

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

index 0e1df1cc35016ef1c9f1597cdafbd6a1ec13aa6c..4cf4c24060106c6867b591f0877257dd8b9f3f3c 100644 (file)
@@ -2655,7 +2655,6 @@ void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id)
 {
        struct route_table *table;
        struct route_node *rn;
-       unsigned changed = 0;
        rib_dest_t *dest;
 
        if (NULL == (table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id))) {
@@ -2682,7 +2681,6 @@ void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id)
         * of the rest of the RE.
         */
        if (dest->selected_fib) {
-               changed = 1;
                if (IS_ZEBRA_DEBUG_RIB) {
                        char buf[PREFIX_STRLEN];
 
@@ -2692,9 +2690,8 @@ void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id)
                        route_entry_dump(&rn->p, NULL, dest->selected_fib);
                }
                rib_uninstall(rn, dest->selected_fib);
-       }
-       if (changed)
                rib_queue_add(rn);
+       }
 }
 
 int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
@@ -3069,6 +3066,8 @@ void rib_update_table(struct route_table *table, rib_update_event_t event)
                                        continue;
 
                                if (re->type != ZEBRA_ROUTE_STATIC) {
+                                       SET_FLAG(re->status,
+                                                ROUTE_ENTRY_CHANGED);
                                        rib_queue_add(rn);
                                        continue;
                                }
@@ -3082,8 +3081,11 @@ void rib_update_table(struct route_table *table, rib_update_event_t event)
                                 * gateway, NHT will
                                 * take care.
                                 */
-                               if (nh)
+                               if (nh) {
+                                       SET_FLAG(re->status,
+                                                ROUTE_ENTRY_CHANGED);
                                        rib_queue_add(rn);
+                               }
                        }
                        break;
 
@@ -3093,8 +3095,12 @@ void rib_update_table(struct route_table *table, rib_update_event_t event)
                         * protocol in
                         * some cases (TODO).
                         */
-                       if (rnode_to_ribs(rn))
+                       if (rnode_to_ribs(rn)) {
+                               RNODE_FOREACH_RE_SAFE (rn, re, next)
+                                       SET_FLAG(re->status,
+                                                ROUTE_ENTRY_CHANGED);
                                rib_queue_add(rn);
+                       }
                        break;
 
                default: