]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pbrd: use bool for pbr_send_pbr_map() return val
authorStephen Worley <sworley@cumulusnetworks.com>
Wed, 23 Sep 2020 18:17:15 +0000 (14:17 -0400)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 7 Oct 2020 08:01:16 +0000 (11:01 +0300)
Use a bool as the return val for pbr_send_pbr_map() to make
the code a bit more readable. Dont expect there to be need
for values other than true or false anyway.

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

index b282db999df55e7fe9340d28474f105be9ca921f..01caff5b52af58a3a914551abdf9274d3705b2fb 100644 (file)
@@ -725,7 +725,7 @@ void pbr_map_policy_delete(struct pbr_map *pbrm, struct pbr_map_interface *pmi)
 
 
        for (ALL_LIST_ELEMENTS_RO(pbrm->seqnumbers, node, pbrms))
-               if (!pbr_send_pbr_map(pbrms, pmi, false, true))
+               if (pbr_send_pbr_map(pbrms, pmi, false, true))
                        sent = true; /* rule removal sent to zebra */
 
        pmi->delete = true;
index 077cb9a691d59c398dde0380466e77ee3d312a8c..8ef675186f21c0d6f51ceecc66368a95d0af1b6a 100644 (file)
@@ -549,8 +549,8 @@ static void pbr_encode_pbr_map_sequence(struct stream *s,
        stream_put(s, ifp->name, INTERFACE_NAMSIZ);
 }
 
-int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
-                    struct pbr_map_interface *pmi, bool install, bool changed)
+bool 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 @@ int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
         * to delete just return.
         */
        if (install && is_installed && !changed)
-               return 1;
+               return false;
 
        if (!install && !is_installed)
-               return 1;
+               return false;
 
        s = zclient->obuf;
        stream_reset(s);
@@ -596,5 +596,5 @@ int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
 
        zclient_send_message(zclient);
 
-       return 0;
+       return true;
 }
index 57c6f080c7217ca9192970e222687ebf4da13d97..e8f9bff5d9dd96079c358e5d13659a8bfd6fef7d 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 int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
-                           struct pbr_map_interface *pmi, bool install,
-                           bool changed);
+extern bool 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);