]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pbrd: add return val for pbr_send_pbr_map()
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 17 Sep 2020 19:32:01 +0000 (15:32 -0400)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 7 Oct 2020 08:01:16 +0000 (11:01 +0300)
Add a return val so caller can know if something was actually sent to
zebra here. Some things need to be cleanued up by the caller
if we arent getting a callback from zapi.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
pbrd/pbr_zebra.c
pbrd/pbr_zebra.h

index 269bd6da8d6f6cffce339e470826900c86feb6f2..077cb9a691d59c398dde0380466e77ee3d312a8c 100644 (file)
@@ -549,8 +549,8 @@ static void pbr_encode_pbr_map_sequence(struct stream *s,
        stream_put(s, ifp->name, INTERFACE_NAMSIZ);
 }
 
-void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
-                     struct pbr_map_interface *pmi, bool install, bool changed)
+int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
+                    struct pbr_map_interface *pmi, bool install, bool changed)
 {
        struct pbr_map *pbrm = pbrms->parent;
        struct stream *s;
@@ -569,10 +569,10 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
         * to delete just return.
         */
        if (install && is_installed && !changed)
-               return;
+               return 1;
 
        if (!install && !is_installed)
-               return;
+               return 1;
 
        s = zclient->obuf;
        stream_reset(s);
@@ -595,4 +595,6 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
        stream_putw_at(s, 0, stream_get_endp(s));
 
        zclient_send_message(zclient);
+
+       return 0;
 }
index cc42e21abee63e2d4580baaa7320c09492ea8149..57c6f080c7217ca9192970e222687ebf4da13d97 100644 (file)
@@ -35,9 +35,9 @@ extern void route_delete(struct pbr_nexthop_group_cache *pnhgc,
 
 extern void pbr_send_rnh(struct nexthop *nhop, bool reg);
 
-extern void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
-                            struct pbr_map_interface *pmi, bool install,
-                            bool changed);
+extern int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
+                           struct pbr_map_interface *pmi, bool install,
+                           bool changed);
 
 extern struct pbr_interface *pbr_if_new(struct interface *ifp);