mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 06:55:18 +00:00
*: Use short version of bool expressions
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
17fe9bb6e5
commit
a8f58eb6a5
@ -383,7 +383,7 @@ int bfdd_bfd_sessions_single_hop_administrative_down_modify(
|
||||
|
||||
bs = nb_running_get_entry(dnode, NULL, true);
|
||||
|
||||
if (shutdown == false) {
|
||||
if (!shutdown) {
|
||||
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_SHUTDOWN))
|
||||
return NB_OK;
|
||||
|
||||
@ -447,7 +447,7 @@ int bfdd_bfd_sessions_single_hop_echo_mode_modify(enum nb_event event,
|
||||
|
||||
bs = nb_running_get_entry(dnode, NULL, true);
|
||||
|
||||
if (echo == false) {
|
||||
if (!echo) {
|
||||
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))
|
||||
return NB_OK;
|
||||
|
||||
|
@ -500,7 +500,7 @@ static void _display_peers_brief(struct vty *vty, const char *vrfname, bool use_
|
||||
|
||||
bvt.vrfname = vrfname;
|
||||
|
||||
if (use_json == false) {
|
||||
if (!use_json) {
|
||||
bvt.vty = vty;
|
||||
|
||||
vty_out(vty, "Session count: %lu\n", bfd_get_session_count());
|
||||
|
@ -3148,7 +3148,7 @@ int bgp_handle_socket(struct bgp *bgp, struct vrf *vrf, vrf_id_t old_vrf_id,
|
||||
/*
|
||||
* suppress vrf socket
|
||||
*/
|
||||
if (create == false) {
|
||||
if (!create) {
|
||||
bgp_close_vrf_socket(bgp);
|
||||
return 0;
|
||||
}
|
||||
|
@ -996,7 +996,7 @@ static int nb_transaction_process(enum nb_event event,
|
||||
* Only try to release resources that were allocated
|
||||
* successfully.
|
||||
*/
|
||||
if (event == NB_EV_ABORT && change->prepare_ok == false)
|
||||
if (event == NB_EV_ABORT && !change->prepare_ok)
|
||||
break;
|
||||
|
||||
/* Call the appropriate callback. */
|
||||
|
@ -2447,7 +2447,7 @@ route_map_result_t route_map_apply(struct route_map *map,
|
||||
}
|
||||
|
||||
for (; index; index = index->next) {
|
||||
if (skip_match_clause == false) {
|
||||
if (!skip_match_clause) {
|
||||
/* Apply this index. */
|
||||
match_ret = route_map_apply_match(&index->match_list,
|
||||
prefix, type, object);
|
||||
|
@ -202,7 +202,7 @@ void pbr_map_reason_string(unsigned int reason, char *buf, int size)
|
||||
void pbr_map_final_interface_deletion(struct pbr_map *pbrm,
|
||||
struct pbr_map_interface *pmi)
|
||||
{
|
||||
if (pmi->delete == true && !pbr_map_interface_is_installed(pbrm, pmi)) {
|
||||
if (pmi->delete && !pbr_map_interface_is_installed(pbrm, pmi)) {
|
||||
listnode_delete(pbrm->incoming, pmi);
|
||||
pmi->pbrm = NULL;
|
||||
|
||||
|
@ -953,7 +953,7 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
|
||||
thread_add_timer_msec(
|
||||
master, vrrp_master_down_timer_expire, r,
|
||||
r->skew_time * CS2MS, &r->t_master_down_timer);
|
||||
} else if (r->vr->preempt_mode == false
|
||||
} else if (!r->vr->preempt_mode
|
||||
|| pkt->hdr.priority >= r->priority) {
|
||||
if (r->vr->version == 3) {
|
||||
r->master_adver_interval =
|
||||
@ -965,7 +965,7 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
|
||||
vrrp_master_down_timer_expire, r,
|
||||
r->master_down_interval * CS2MS,
|
||||
&r->t_master_down_timer);
|
||||
} else if (r->vr->preempt_mode == true
|
||||
} else if (r->vr->preempt_mode
|
||||
&& pkt->hdr.priority < r->priority) {
|
||||
/* Discard advertisement */
|
||||
DEBUGD(&vrrp_dbg_proto,
|
||||
@ -1834,7 +1834,7 @@ static int vrrp_autoconfig_if_add(struct interface *ifp)
|
||||
created = true;
|
||||
}
|
||||
|
||||
if (!vr || vr->autoconf == false)
|
||||
if (!vr || !vr->autoconf)
|
||||
return 0;
|
||||
|
||||
if (!created) {
|
||||
|
@ -605,7 +605,7 @@ int32_t zebra_mlag_test_mlag_internal(const char *none, const char *primary,
|
||||
zsend_capabilities_all_clients();
|
||||
if (zrouter.mlag_info.role != MLAG_ROLE_NONE) {
|
||||
if (zrouter.mlag_info.clients_interested_cnt == 0
|
||||
&& test_mlag_in_progress == false) {
|
||||
&& !test_mlag_in_progress) {
|
||||
if (zrouter.mlag_info.zebra_pth_mlag == NULL)
|
||||
zebra_mlag_spawn_pthread();
|
||||
zrouter.mlag_info.clients_interested_cnt++;
|
||||
@ -613,7 +613,7 @@ int32_t zebra_mlag_test_mlag_internal(const char *none, const char *primary,
|
||||
hook_call(zebra_mlag_private_open_channel);
|
||||
}
|
||||
} else {
|
||||
if (test_mlag_in_progress == true) {
|
||||
if (test_mlag_in_progress) {
|
||||
test_mlag_in_progress = false;
|
||||
zrouter.mlag_info.clients_interested_cnt--;
|
||||
hook_call(zebra_mlag_private_close_channel);
|
||||
@ -790,7 +790,7 @@ int zebra_mlag_protobuf_encode_client_data(struct stream *s, uint32_t *msg_type)
|
||||
vrf_name_len);
|
||||
}
|
||||
}
|
||||
if (cleanup == false) {
|
||||
if (!cleanup) {
|
||||
Bulk_msg.mroute_add = pay_load;
|
||||
len = zebra_mlag_mroute_add_bulk__pack(&Bulk_msg,
|
||||
tmp_buf);
|
||||
@ -804,7 +804,7 @@ int zebra_mlag_protobuf_encode_client_data(struct stream *s, uint32_t *msg_type)
|
||||
XFREE(MTYPE_MLAG_PBUF, pay_load[i]);
|
||||
}
|
||||
XFREE(MTYPE_MLAG_PBUF, pay_load);
|
||||
if (cleanup == true)
|
||||
if (cleanup)
|
||||
return -1;
|
||||
} break;
|
||||
case MLAG_MROUTE_DEL_BULK: {
|
||||
|
Loading…
Reference in New Issue
Block a user