pimd: Fix warnings for pimd

Fix warnings for verify source and formatting

Signed-off-by: Soumya Roy <souroy@nvidia.com>
(cherry picked from commit 60c0ac1bd8)
This commit is contained in:
Soumya Roy 2025-11-21 10:47:55 -08:00 committed by Mergify
parent 62dd89e939
commit f4edccbb01
5 changed files with 29 additions and 44 deletions

View file

@ -1038,14 +1038,12 @@ int pim_if_del_vif(struct interface *ifp)
__func__, pim_ifp->mroute_vif_index, ifp->name,
ifp->ifindex);
return -1;
} else {
if (PIM_DEBUG_ZEBRA)
zlog_debug(
"%s: vif_index=%d on interface %s ifindex=%d",
__func__, pim_ifp->mroute_vif_index, ifp->name,
ifp->ifindex);
}
if (PIM_DEBUG_ZEBRA)
zlog_debug("%s: vif_index=%d on interface %s ifindex=%d", __func__,
pim_ifp->mroute_vif_index, ifp->name, ifp->ifindex);
/* if the device was a pim_vxlan iif/oif update vxlan mroute entries */
pim_vxlan_del_vif(ifp);
@ -1898,9 +1896,8 @@ static int pim_ifp_up(struct interface *ifp)
* operational state may be down at that moment, create one now if
* not created.
*/
if (if_is_operative(ifp) && (!pim->regiface)) {
if (if_is_operative(ifp) && (!pim->regiface))
pim_if_create_pimreg(pim);
}
/*
* If we have a pimreg device callback and it's for a specific

View file

@ -554,18 +554,14 @@ static inline void pim_mlag_vxlan_state_update(void)
/********************API to process PIM MLAG Data ************************/
static void pim_mlag_peer_zebra_flag_set(void)
{
if (CHECK_FLAG(router->mlag_flags,
PIM_MLAGF_PEER_ZEBRA_UP_NOTIFY_RECEIVE_PENDING)) {
if (!(CHECK_FLAG(router->mlag_flags,
PIM_MLAGF_PEER_ZEBRA_UP))) {
if (CHECK_FLAG(router->mlag_flags, PIM_MLAGF_PEER_ZEBRA_UP_NOTIFY_RECEIVE_PENDING)) {
if (!(CHECK_FLAG(router->mlag_flags, PIM_MLAGF_PEER_ZEBRA_UP))) {
if (PIM_DEBUG_MLAG)
zlog_debug(
"%s: update Mlag flag with PIM_MLAGF_PEER_ZEBRA_UP",
__func__);
zlog_debug("%s: update Mlag flag with PIM_MLAGF_PEER_ZEBRA_UP",
__func__);
SET_FLAG(router->mlag_flags, PIM_MLAGF_PEER_ZEBRA_UP);
UNSET_FLAG(
router->mlag_flags,
PIM_MLAGF_PEER_ZEBRA_UP_NOTIFY_RECEIVE_PENDING);
UNSET_FLAG(router->mlag_flags,
PIM_MLAGF_PEER_ZEBRA_UP_NOTIFY_RECEIVE_PENDING);
}
}
}
@ -674,13 +670,10 @@ static void pim_mlag_process_peer_frr_state_change(struct mlag_frr_status msg)
(msg.frr_state == MLAG_FRR_STATE_UP ? "UP" : "DOWN"));
if (!(router->mlag_flags & PIM_MLAGF_LOCAL_CONN_UP)) {
SET_FLAG(router->mlag_flags,
PIM_MLAGF_PEER_ZEBRA_UP_NOTIFY_RECEIVE_PENDING);
SET_FLAG(router->mlag_flags, PIM_MLAGF_PEER_ZEBRA_UP_NOTIFY_RECEIVE_PENDING);
if (PIM_DEBUG_MLAG)
zlog_debug(
"%s: msg ignored mlagd process state down, \
Setting Local MLAG Pending flag",
__func__);
zlog_debug("%s: msg ignored mlagd process state down, Setting Local MLAG Pending flag",
__func__);
return;
}
++router->mlag_stats.msg.peer_zebra_status_updates;
@ -690,9 +683,8 @@ static void pim_mlag_process_peer_frr_state_change(struct mlag_frr_status msg)
if (!(router->mlag_flags & PIM_MLAGF_PEER_ZEBRA_UP)) {
router->mlag_flags |= PIM_MLAGF_PEER_ZEBRA_UP;
if (PIM_DEBUG_MLAG)
zlog_debug(
"%s:%d: Mlag Peer FRR state is UP Setting PIM_MLAGF_PEER_ZEBRA_UP mlag flag %0x",
__func__, __LINE__, router->mlag_flags);
zlog_debug("%s:%d: Mlag Peer FRR state is UP Setting PIM_MLAGF_PEER_ZEBRA_UP mlag flag %0x",
__func__, __LINE__, router->mlag_flags);
/* XXX - when peer zebra comes up we need to wait for
* for some time to let the peer setup MDTs before
* before relinquishing DF status
@ -705,9 +697,8 @@ static void pim_mlag_process_peer_frr_state_change(struct mlag_frr_status msg)
++router->mlag_stats.peer_zebra_downs;
router->mlag_flags &= ~PIM_MLAGF_PEER_ZEBRA_UP;
if (PIM_DEBUG_MLAG)
zlog_debug(
"%s:%d: Mlag Peer FRR state is DOWN unsetting PIM_MLAGF_PEER_ZEBRA_UP mlag flag %0x",
__func__, __LINE__, router->mlag_flags);
zlog_debug("%s:%d: Mlag Peer FRR state is DOWN unsetting PIM_MLAGF_PEER_ZEBRA_UP mlag flag %0x",
__func__, __LINE__, router->mlag_flags);
/* when a peer zebra goes down we assume DF role */
pim_mlag_up_local_reeval(true /*mlagd_send*/,
"zebra_down");

View file

@ -689,9 +689,8 @@ int pim_register_recv(struct interface *ifp, pim_addr dest_addr,
((SwitchToSptDesiredOnRp(pim, &sg)) &&
pim_upstream_inherited_olist(pim, upstream) == 0)) {
if (PIM_DEBUG_PIM_REG)
zlog_debug(
"sending pim register stop message : %s ",
upstream->sg_str);
zlog_debug("sending pim register stop message : %s ",
upstream->sg_str);
pim_register_stop_send(ifp, &sg, dest_addr, src_addr);
sentRegisterStop = 1;
} else {

View file

@ -459,18 +459,17 @@ int pim_socket_getsockname(int fd, struct sockaddr *name, socklen_t *namelen)
int pim_reg_sock_bind(struct pim_instance *pim)
{
if (pim->vrf->vrf_id != VRF_DEFAULT) {
struct interface *ifp =
if_lookup_by_name(pim->vrf->name, pim->vrf->vrf_id);
struct interface *ifp = if_lookup_by_name(pim->vrf->name, pim->vrf->vrf_id);
if (ifp) {
if (pim_socket_bind(pim->reg_sock, ifp)) {
zlog_warn(
"%s: Could not set reg_sock fd: %d for interface: %s to device",
__func__, pim->reg_sock, ifp->name);
zlog_warn("%s: Could not set reg_sock fd: %d for interface: %s to device",
__func__, pim->reg_sock, ifp->name);
return PIM_SOCK_ERR_BIND;
}
} else {
zlog_warn("%s: vrf interface lookup failed %s id %d",
__func__, pim->vrf->name, pim->vrf->vrf_id);
zlog_warn("%s: vrf interface lookup failed %s id %d", __func__,
pim->vrf->name, pim->vrf->vrf_id);
return PIM_SOCK_ERR_SOCKET;
}
}

View file

@ -947,11 +947,10 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
* In FHR pimreg interface is needed all the time
* inorder to send register packets.
*/
if (PIM_UPSTREAM_FLAG_TEST_FHR(up->flags) &&
up->reg_state == PIM_REG_NOINFO &&
if (PIM_UPSTREAM_FLAG_TEST_FHR(up->flags) && up->reg_state == PIM_REG_NOINFO &&
pim->regiface->configured) {
pim_channel_add_oif(up->channel_oil, pim->regiface,
PIM_OIF_FLAG_PROTO_PIM, __func__);
pim_channel_add_oif(up->channel_oil, pim->regiface, PIM_OIF_FLAG_PROTO_PIM,
__func__);
}
forward_off(up);
/*