mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-31 20:57:51 +00:00
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>
This commit is contained in:
parent
fe870621b5
commit
5d06c5d5ef
@ -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))
|
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 */
|
sent = true; /* rule removal sent to zebra */
|
||||||
|
|
||||||
pmi->delete = true;
|
pmi->delete = true;
|
||||||
|
@ -549,7 +549,7 @@ static void pbr_encode_pbr_map_sequence(struct stream *s,
|
|||||||
stream_put(s, ifp->name, INTERFACE_NAMSIZ);
|
stream_put(s, ifp->name, INTERFACE_NAMSIZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
|
bool pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
|
||||||
struct pbr_map_interface *pmi, bool install, bool changed)
|
struct pbr_map_interface *pmi, bool install, bool changed)
|
||||||
{
|
{
|
||||||
struct pbr_map *pbrm = pbrms->parent;
|
struct pbr_map *pbrm = pbrms->parent;
|
||||||
@ -569,10 +569,10 @@ int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
|
|||||||
* to delete just return.
|
* to delete just return.
|
||||||
*/
|
*/
|
||||||
if (install && is_installed && !changed)
|
if (install && is_installed && !changed)
|
||||||
return 1;
|
return false;
|
||||||
|
|
||||||
if (!install && !is_installed)
|
if (!install && !is_installed)
|
||||||
return 1;
|
return false;
|
||||||
|
|
||||||
s = zclient->obuf;
|
s = zclient->obuf;
|
||||||
stream_reset(s);
|
stream_reset(s);
|
||||||
@ -596,5 +596,5 @@ int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
|
|||||||
|
|
||||||
zclient_send_message(zclient);
|
zclient_send_message(zclient);
|
||||||
|
|
||||||
return 0;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ extern void route_delete(struct pbr_nexthop_group_cache *pnhgc,
|
|||||||
|
|
||||||
extern void pbr_send_rnh(struct nexthop *nhop, bool reg);
|
extern void pbr_send_rnh(struct nexthop *nhop, bool reg);
|
||||||
|
|
||||||
extern int pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
|
extern bool pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
|
||||||
struct pbr_map_interface *pmi, bool install,
|
struct pbr_map_interface *pmi, bool install,
|
||||||
bool changed);
|
bool changed);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user