]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ISIS VRF: Route info with vrf_id from ISIS to Zebra
authorKaushik <kaushik@niralnetworks.com>
Fri, 19 Jun 2020 18:46:12 +0000 (11:46 -0700)
committerKaushik <kaushik@niralnetworks.com>
Fri, 19 Jun 2020 18:46:12 +0000 (11:46 -0700)
1. The "VRF_DEFAULT" param is changed to "isis->vrf_id" before
   sending the routes to zebra.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
isisd/isis_route.c
isisd/isis_zebra.c
isisd/isis_zebra.h

index fa6af6c216ff1b93a47d712fb8f2816012d763e7..ffb5bdb357399b5394f6948da1e4ed0d8ef998cf 100644 (file)
@@ -355,7 +355,7 @@ static void isis_route_update(struct isis_area *area, struct prefix *prefix,
                if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED))
                        return;
 
-               isis_zebra_route_add_route(prefix, src_p, route_info);
+               isis_zebra_route_add_route(area->isis, prefix, src_p, route_info);
                hook_call(isis_route_update_hook, area, prefix, route_info);
 
                SET_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
@@ -364,7 +364,7 @@ static void isis_route_update(struct isis_area *area, struct prefix *prefix,
                if (!CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED))
                        return;
 
-               isis_zebra_route_del_route(prefix, src_p, route_info);
+               isis_zebra_route_del_route(area->isis, prefix, src_p, route_info);
                hook_call(isis_route_update_hook, area, prefix, route_info);
 
                UNSET_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
index e0bf0cee14b65e751f18ae84894ea3cc37f25a19..502a598523c9da00644c7df77b8a7c397d32a3c0 100644 (file)
@@ -157,7 +157,8 @@ static int isis_zebra_link_params(ZAPI_CALLBACK_ARGS)
        return 0;
 }
 
-void isis_zebra_route_add_route(struct prefix *prefix,
+void isis_zebra_route_add_route(struct isis *isis,
+                               struct prefix *prefix,
                                struct prefix_ipv6 *src_p,
                                struct isis_route_info *route_info)
 {
@@ -171,7 +172,7 @@ void isis_zebra_route_add_route(struct prefix *prefix,
                return;
 
        memset(&api, 0, sizeof(api));
-       api.vrf_id = VRF_DEFAULT;
+       api.vrf_id = isis->vrf_id;
        api.type = PROTO_TYPE;
        api.safi = SAFI_UNICAST;
        api.prefix = *prefix;
@@ -194,7 +195,7 @@ void isis_zebra_route_add_route(struct prefix *prefix,
                api_nh = &api.nexthops[count];
                if (fabricd)
                        SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_ONLINK);
-               api_nh->vrf_id = VRF_DEFAULT;
+               api_nh->vrf_id = isis->vrf_id;
 
                switch (nexthop->family) {
                case AF_INET:
@@ -232,7 +233,8 @@ void isis_zebra_route_add_route(struct prefix *prefix,
        zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api);
 }
 
-void isis_zebra_route_del_route(struct prefix *prefix,
+void isis_zebra_route_del_route(struct isis *isis,
+                               struct prefix *prefix,
                                struct prefix_ipv6 *src_p,
                                struct isis_route_info *route_info)
 {
@@ -242,7 +244,7 @@ void isis_zebra_route_del_route(struct prefix *prefix,
                return;
 
        memset(&api, 0, sizeof(api));
-       api.vrf_id = VRF_DEFAULT;
+       api.vrf_id = isis->vrf_id;
        api.type = PROTO_TYPE;
        api.safi = SAFI_UNICAST;
        api.prefix = *prefix;
index b143d34626bd9d7643260837d27c173869e831b6..2fb54a629144f35cef64fd3b8488a887f0b56929 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef _ZEBRA_ISIS_ZEBRA_H
 #define _ZEBRA_ISIS_ZEBRA_H
 
+#include "isisd.h"
+
 extern struct zclient *zclient;
 
 struct label_chunk {
@@ -38,10 +40,12 @@ struct isis_route_info;
 struct sr_prefix;
 struct sr_adjacency;
 
-void isis_zebra_route_add_route(struct prefix *prefix,
+void isis_zebra_route_add_route(struct isis *isis,
+                               struct prefix *prefix,
                                struct prefix_ipv6 *src_p,
                                struct isis_route_info *route_info);
-void isis_zebra_route_del_route(struct prefix *prefix,
+void isis_zebra_route_del_route(struct isis *isis,
+                               struct prefix *prefix,
                                struct prefix_ipv6 *src_p,
                                struct isis_route_info *route_info);
 void isis_zebra_send_prefix_sid(int cmd, const struct sr_prefix *srp);