summaryrefslogtreecommitdiffstats
path: root/zebra/redistribute.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-08-10 01:56:08 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-08-17 22:04:50 +0200
commitb0385873fafa4ce92f9e16469ab44f01eadd1b9f (patch)
treead759697d4661ab82833f46b8db08de603842ec1 /zebra/redistribute.c
parentzebra: Introduce early route processing on the MetaQ (diff)
downloadfrr-b0385873fafa4ce92f9e16469ab44f01eadd1b9f.tar.xz
frr-b0385873fafa4ce92f9e16469ab44f01eadd1b9f.zip
zebra: Create a zebra_rib_route_entry_new function and use it
Abstract the creation of the route_entry and use it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/redistribute.c')
-rw-r--r--zebra/redistribute.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 1a28f8cee..4a8fe938e 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -685,15 +685,10 @@ int zebra_add_import_table_entry(struct zebra_vrf *zvrf, struct route_node *rn,
zebra_del_import_table_entry(zvrf, rn, same);
}
- 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 = zvrf->table_id;
- newre->uptime = monotime(NULL);
- newre->instance = re->table;
+ newre = zebra_rib_route_entry_new(
+ 0, ZEBRA_ROUTE_TABLE, re->table, re->flags, re->nhe_id,
+ zvrf->table_id, re->metric, re->mtu,
+ zebra_import_table_distance[afi][re->table], re->tag);
ng = nexthop_group_new();
copy_nexthops(&ng->nexthop, re->nhe->nhg.nexthop, NULL);