From 3e6ad80a1758c8bb13c639a09eff13c8383d6127 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Wed, 23 Sep 2020 14:17:15 -0400 Subject: [PATCH] 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 --- pbrd/pbr_map.c | 2 +- pbrd/pbr_zebra.c | 10 +++++----- pbrd/pbr_zebra.h | 6 +++--- 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); -- 2.39.5