]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: resolve issue when changing import-table route-map config 2092/head
authorDon Slice <dslice@cumulusnetworks.com>
Thu, 19 Apr 2018 21:04:05 +0000 (21:04 +0000)
committerDon Slice <dslice@cumulusnetworks.com>
Thu, 19 Apr 2018 21:07:20 +0000 (14:07 -0700)
When changing from "ip import-table 10 route-map rdn" to "ip
import-table 10" without a route-map, routes would be deleted
and not reinstalled.  This fix resolves that problem.

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

index 2e19d6fb75c1cac47f004dcdc98d1994b44e10b1..a51cd6ecc94342c5600e12497e4c0b02ddce8f13 100644 (file)
@@ -616,8 +616,10 @@ int zebra_import_table(afi_t afi, uint32_t table_id, uint32_t distance,
                else {
                        rmap_name =
                                zebra_get_import_table_route_map(afi, table_id);
-                       if (rmap_name)
+                       if (rmap_name) {
                                zebra_del_import_table_route_map(afi, table_id);
+                               rmap_name = NULL;
+                       }
                }
 
                zebra_import_table_used[afi][table_id] = 1;
@@ -628,8 +630,10 @@ int zebra_import_table(afi_t afi, uint32_t table_id, uint32_t distance,
                        ZEBRA_TABLE_DISTANCE_DEFAULT;
 
                rmap_name = zebra_get_import_table_route_map(afi, table_id);
-               if (rmap_name)
+               if (rmap_name) {
                        zebra_del_import_table_route_map(afi, table_id);
+                       rmap_name = NULL;
+               }
        }
 
        for (rn = route_top(table); rn; rn = route_next(rn)) {