summaryrefslogtreecommitdiff
path: root/pbrd
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2020-09-23 14:17:15 -0400
committerStephen Worley <sworley@cumulusnetworks.com>2020-09-23 14:17:15 -0400
commit5d06c5d5ef50b66f7ffc2fee70c20f49d064aa87 (patch)
tree4b7477ec79aa225e58b74489cac722ceadedff77 /pbrd
parentfe870621b577e3a486604b95cedd4fde86d36ccd (diff)
pbrd: use bool for pbr_send_pbr_map() return val
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>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_map.c2
-rw-r--r--pbrd/pbr_zebra.c10
-rw-r--r--pbrd/pbr_zebra.h6
3 files changed, 9 insertions, 9 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c
index b282db999d..01caff5b52 100644
--- a/pbrd/pbr_map.c
+++ b/pbrd/pbr_map.c
@@ -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;
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index 077cb9a691..8ef675186f 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -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;
}
diff --git a/pbrd/pbr_zebra.h b/pbrd/pbr_zebra.h
index 57c6f080c7..e8f9bff5d9 100644
--- a/pbrd/pbr_zebra.h
+++ b/pbrd/pbr_zebra.h
@@ -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);