summaryrefslogtreecommitdiff
path: root/zebra/zapi_msg.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2024-01-11 17:23:28 -0300
committerRafael Zalamena <rzalamena@opensourcerouting.org>2025-01-23 14:37:09 -0300
commit28a9ca3405a6f7923b5a51b0e2db6844928676db (patch)
tree5eac66f25964ae92201875ae803ba4d1b839eb13 /zebra/zapi_msg.c
parentdfdc12e1647341bd2402986c5753102ee2bbe4ab (diff)
lib,zebra: VRF table-direct support
Implement the necessary data structures and code changes to support sending table-direct routes to protocols running in different VRFs. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'zebra/zapi_msg.c')
-rw-r--r--zebra/zapi_msg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index ab55998af0..f32d8ea6c6 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -509,9 +509,8 @@ int zsend_interface_update(int cmd, struct zserv *client, struct interface *ifp)
return zserv_send_message(client, s);
}
-int zsend_redistribute_route(int cmd, struct zserv *client,
- const struct route_node *rn,
- const struct route_entry *re, bool is_table_direct)
+int zsend_redistribute_route(int cmd, struct zserv *client, const struct route_node *rn,
+ const struct route_entry *re, vrf_id_t *to_vrf)
{
struct zapi_route api;
struct zapi_nexthop *api_nh;
@@ -527,9 +526,10 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
api.vrf_id = re->vrf_id;
api.type = re->type;
api.safi = SAFI_UNICAST;
- if (is_table_direct) {
+ if (to_vrf != NULL) {
api.instance = re->table;
api.type = ZEBRA_ROUTE_TABLE_DIRECT;
+ api.vrf_id = *to_vrf;
} else
api.instance = re->instance;
api.flags = re->flags;
@@ -598,7 +598,7 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
/* Attributes. */
SET_FLAG(api.message, ZAPI_MESSAGE_DISTANCE);
- if (is_table_direct)
+ if (to_vrf != NULL)
api.distance = ZEBRA_TABLEDIRECT_DISTANCE_DEFAULT;
else
api.distance = re->distance;