From 3660beec291a9d1e5a9b4b24a95b6d48d455a002 Mon Sep 17 00:00:00 2001 From: Don Slice Date: Thu, 19 Apr 2018 21:04:05 +0000 Subject: [PATCH] zebra: resolve issue when changing import-table route-map config 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 --- zebra/redistribute.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 2e19d6fb75..a51cd6ecc9 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -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)) { -- 2.39.5