mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 04:47:05 +00:00
Merge pull request #15552 from sri-mohan1/srib-24-zebra-a
zebra: changes for code maintainability
This commit is contained in:
commit
502d1937da
@ -6351,7 +6351,7 @@ dplane_provider_dequeue_out_ctx(struct zebra_dplane_provider *prov)
|
|||||||
*/
|
*/
|
||||||
bool dplane_provider_is_threaded(const struct zebra_dplane_provider *prov)
|
bool dplane_provider_is_threaded(const struct zebra_dplane_provider *prov)
|
||||||
{
|
{
|
||||||
return (prov->dp_flags & DPLANE_PROV_FLAG_THREADED);
|
return CHECK_FLAG(prov->dp_flags, DPLANE_PROV_FLAG_THREADED);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_NETLINK
|
#ifdef HAVE_NETLINK
|
||||||
|
@ -329,7 +329,7 @@ static void fec_evaluate(struct zebra_vrf *zvrf)
|
|||||||
|
|
||||||
/* Skip configured FECs and those without a label index.
|
/* Skip configured FECs and those without a label index.
|
||||||
*/
|
*/
|
||||||
if (fec->flags & FEC_FLAG_CONFIGURED
|
if (CHECK_FLAG(fec->flags, FEC_FLAG_CONFIGURED)
|
||||||
|| fec->label_index == MPLS_INVALID_LABEL_INDEX)
|
|| fec->label_index == MPLS_INVALID_LABEL_INDEX)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -2420,7 +2420,7 @@ static int zebra_mpls_cleanup_fecs_for_client(struct zserv *client)
|
|||||||
if (fec_client == client) {
|
if (fec_client == client) {
|
||||||
listnode_delete(fec->client_list,
|
listnode_delete(fec->client_list,
|
||||||
fec_client);
|
fec_client);
|
||||||
if (!(fec->flags & FEC_FLAG_CONFIGURED)
|
if (!CHECK_FLAG(fec->flags, FEC_FLAG_CONFIGURED)
|
||||||
&& list_isempty(fec->client_list))
|
&& list_isempty(fec->client_list))
|
||||||
fec_del(fec);
|
fec_del(fec);
|
||||||
break;
|
break;
|
||||||
@ -2538,7 +2538,7 @@ int zebra_mpls_static_fec_add(struct zebra_vrf *zvrf, struct prefix *p,
|
|||||||
if (IS_ZEBRA_DEBUG_MPLS)
|
if (IS_ZEBRA_DEBUG_MPLS)
|
||||||
zlog_debug("Add fec %pFX label %u", p, in_label);
|
zlog_debug("Add fec %pFX label %u", p, in_label);
|
||||||
} else {
|
} else {
|
||||||
fec->flags |= FEC_FLAG_CONFIGURED;
|
SET_FLAG(fec->flags, FEC_FLAG_CONFIGURED);
|
||||||
if (fec->label == in_label)
|
if (fec->label == in_label)
|
||||||
/* Duplicate config */
|
/* Duplicate config */
|
||||||
return 0;
|
return 0;
|
||||||
@ -2587,7 +2587,7 @@ int zebra_mpls_static_fec_del(struct zebra_vrf *zvrf, struct prefix *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
old_label = fec->label;
|
old_label = fec->label;
|
||||||
fec->flags &= ~FEC_FLAG_CONFIGURED;
|
UNSET_FLAG(fec->flags, FEC_FLAG_CONFIGURED);
|
||||||
fec->label = MPLS_INVALID_LABEL;
|
fec->label = MPLS_INVALID_LABEL;
|
||||||
|
|
||||||
/* If no client exists, just delete the FEC. */
|
/* If no client exists, just delete the FEC. */
|
||||||
@ -2630,7 +2630,7 @@ int zebra_mpls_write_fec_config(struct vty *vty, struct zebra_vrf *zvrf)
|
|||||||
char lstr[BUFSIZ];
|
char lstr[BUFSIZ];
|
||||||
fec = rn->info;
|
fec = rn->info;
|
||||||
|
|
||||||
if (!(fec->flags & FEC_FLAG_CONFIGURED))
|
if (!CHECK_FLAG(fec->flags, FEC_FLAG_CONFIGURED))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
write = 1;
|
write = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user