]> git.proxmox.com Git - mirror_frr.git/commitdiff
sharpd: Add ability to pass vrf we want to watch
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 28 Feb 2019 13:12:32 +0000 (08:12 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 1 Mar 2019 21:15:02 +0000 (16:15 -0500)
Add the ability for the sharp zebra code to pass down the
vrf that we want to watch.  At this point in time, we
cannot use it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
sharpd/sharp_vty.c
sharpd/sharp_zebra.c
sharpd/sharp_zebra.h

index 21fa3cf744f4b4e03c8f86559f3d74632840f275..74550d82d48d6a0095d124abffe4517bfe49cf00 100644 (file)
@@ -63,7 +63,8 @@ DEFPY(watch_nexthop_v6, watch_nexthop_v6_cmd,
        p.family = AF_INET6;
 
        sharp_nh_tracker_get(&p);
-       sharp_zebra_nexthop_watch(&p, type_import, true, !!connected);
+       sharp_zebra_nexthop_watch(&p, VRF_DEFAULT, type_import,
+                                 true, !!connected);
 
        return CMD_SUCCESS;
 }
@@ -92,7 +93,8 @@ DEFPY(watch_nexthop_v4, watch_nexthop_v4_cmd,
        p.family = AF_INET;
 
        sharp_nh_tracker_get(&p);
-       sharp_zebra_nexthop_watch(&p, type_import, true, !!connected);
+       sharp_zebra_nexthop_watch(&p, VRF_DEFAULT, type_import,
+                                 true, !!connected);
 
        return CMD_SUCCESS;
 }
index 942040b8021b5317d943cf1fff31e94d9de0e7c4..f1e83628c2ee5876eccb17fc1804f6ab281108d7 100644 (file)
@@ -323,7 +323,7 @@ void route_delete(struct prefix *p, vrf_id_t vrf_id, uint8_t instance)
        return;
 }
 
-void sharp_zebra_nexthop_watch(struct prefix *p, bool import,
+void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id, bool import,
                               bool watch, bool connected)
 {
        int command;
@@ -340,7 +340,7 @@ void sharp_zebra_nexthop_watch(struct prefix *p, bool import,
                        command = ZEBRA_IMPORT_ROUTE_UNREGISTER;
        }
 
-       if (zclient_send_rnh(zclient, command, p, connected, VRF_DEFAULT) < 0)
+       if (zclient_send_rnh(zclient, command, p, connected, vrf_id) < 0)
                zlog_warn("%s: Failure to send nexthop to zebra",
                          __PRETTY_FUNCTION__);
 }
index 7c3c39c89269dbf947f3f5670c33429fc8b6ec46..57ffcc7690dabb7ecd0121d16c61b234911b4f83 100644 (file)
@@ -28,8 +28,8 @@ extern void vrf_label_add(vrf_id_t vrf_id, afi_t afi, mpls_label_t label);
 extern void route_add(struct prefix *p, vrf_id_t, uint8_t instance,
                      struct nexthop_group *nhg);
 extern void route_delete(struct prefix *p, vrf_id_t vrf_id, uint8_t instance);
-extern void sharp_zebra_nexthop_watch(struct prefix *p, bool import,
-                                     bool watch, bool connected);
+extern void sharp_zebra_nexthop_watch(struct prefix *p, vrf_id_t vrf_id,
+                                     bool import, bool watch, bool connected);
 
 extern void sharp_install_routes_helper(struct prefix *p, vrf_id_t vrf_id,
                                        uint8_t instance,