summaryrefslogtreecommitdiffstats
path: root/zebra/redistribute.c
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2017-10-04 15:41:49 +0200
committerDon Slice <dslice@cumulusnetworks.com>2017-10-05 18:08:46 +0200
commit5c4b6e577c33432b1e1eb9b2f30231a555111f0b (patch)
tree98181fa22e23877db0b0c7de8270e4c14bda7b9b /zebra/redistribute.c
parentMerge pull request #1244 from donaldsharp/flush_routes (diff)
downloadfrr-5c4b6e577c33432b1e1eb9b2f30231a555111f0b.tar.xz
frr-5c4b6e577c33432b1e1eb9b2f30231a555111f0b.zip
zebra: resolve issue with importing table entries correctly
Problem reported when a table entry originated by rdnbrd was moved from one interface to another on the same switch. Both would be deleted, leaving no imported entry in the table. Modified zebra_add_import_table_entry to used rib_add_multipath as well as correct the call to delete a duplicate entry to include the nexthop associated with the route_entry. Ticket: CM-18154 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed By: CCR-6731 Testing Done: Manual testing successful, deb given to submitter, bgp-smoke had no new failures
Diffstat (limited to '')
-rw-r--r--zebra/redistribute.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 890ad887d..cc679142f 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -519,32 +519,20 @@ int zebra_add_import_table_entry(struct route_node *rn, struct route_entry *re,
if (same)
zebra_del_import_table_entry(rn, same);
- if (re->nexthop_num == 1) {
- rib_add(afi, SAFI_UNICAST, re->vrf_id,
- ZEBRA_ROUTE_TABLE, re->table, 0, &p,
- NULL, re->nexthop,
- zebrad.rtm_table_default, re->metric,
- re->mtu,
- zebra_import_table_distance[afi]
- [re->table]);
- } else if (re->nexthop_num > 1) {
- newre = XCALLOC(MTYPE_RE,
- sizeof(struct route_entry));
- newre->type = ZEBRA_ROUTE_TABLE;
- newre->distance =
- zebra_import_table_distance[afi][re->table];
- newre->flags = re->flags;
- newre->metric = re->metric;
- newre->mtu = re->mtu;
- newre->table = zebrad.rtm_table_default;
- newre->nexthop_num = 0;
- newre->uptime = time(NULL);
- newre->instance = re->table;
- route_entry_copy_nexthops(newre, re->nexthop);
-
- rib_add_multipath(afi, SAFI_UNICAST, &p,
- NULL, newre);
- }
+ newre = XCALLOC(MTYPE_RE,sizeof(struct route_entry));
+ newre->type = ZEBRA_ROUTE_TABLE;
+ newre->distance = zebra_import_table_distance[afi][re->table];
+ newre->flags = re->flags;
+ newre->metric = re->metric;
+ newre->mtu = re->mtu;
+ newre->table = zebrad.rtm_table_default;
+ newre->nexthop_num = 0;
+ newre->uptime = time(NULL);
+ newre->instance = re->table;
+ route_entry_copy_nexthops(newre, re->nexthop);
+
+ rib_add_multipath(afi, SAFI_UNICAST, &p, NULL, newre);
+
return 0;
}
@@ -557,7 +545,7 @@ int zebra_del_import_table_entry(struct route_node *rn, struct route_entry *re)
prefix_copy(&p, &rn->p);
rib_delete(afi, SAFI_UNICAST, re->vrf_id, ZEBRA_ROUTE_TABLE,
- re->table, re->flags, &p, NULL, NULL,
+ re->table, re->flags, &p, NULL, re->nexthop,
zebrad.rtm_table_default, re->metric, false);
return 0;