mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
Merge pull request #18675 from mjstapp/fix_clang_18_warnings
lib,pimd,bgpd,bfdd: Fix clang 18 warnings
This commit is contained in:
commit
5d4c7d2ece
|
@ -2518,7 +2518,7 @@ void sbfd_reflector_free(const uint32_t discr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sbfd_reflector_flush()
|
void sbfd_reflector_flush(void)
|
||||||
{
|
{
|
||||||
sbfd_discr_iterate(_sbfd_reflector_free, NULL);
|
sbfd_discr_iterate(_sbfd_reflector_free, NULL);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3542,7 +3542,6 @@ static int bmp_bgp_attribute_updated(struct bgp *bgp, bool withdraw)
|
||||||
struct bmp_targets *bt;
|
struct bmp_targets *bt;
|
||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
struct bmp_imported_bgp *bib;
|
struct bmp_imported_bgp *bib;
|
||||||
int ret = 0;
|
|
||||||
struct stream *s = bmp_peerstate(bgp->peer_self, withdraw);
|
struct stream *s = bmp_peerstate(bgp->peer_self, withdraw);
|
||||||
struct bmp *bmp;
|
struct bmp *bmp;
|
||||||
afi_t afi;
|
afi_t afi;
|
||||||
|
@ -3553,8 +3552,8 @@ static int bmp_bgp_attribute_updated(struct bgp *bgp, bool withdraw)
|
||||||
|
|
||||||
if (bmpbgp) {
|
if (bmpbgp) {
|
||||||
frr_each (bmp_targets, &bmpbgp->targets, bt) {
|
frr_each (bmp_targets, &bmpbgp->targets, bt) {
|
||||||
ret = bmp_bgp_attribute_updated_instance(bt, &bmpbgp->vrf_state, bgp,
|
bmp_bgp_attribute_updated_instance(bt, &bmpbgp->vrf_state, bgp,
|
||||||
withdraw, s);
|
withdraw, s);
|
||||||
if (withdraw)
|
if (withdraw)
|
||||||
continue;
|
continue;
|
||||||
frr_each (bmp_session, &bt->sessions, bmp) {
|
frr_each (bmp_session, &bt->sessions, bmp) {
|
||||||
|
@ -3575,8 +3574,8 @@ static int bmp_bgp_attribute_updated(struct bgp *bgp, bool withdraw)
|
||||||
frr_each (bmp_imported_bgps, &bt->imported_bgps, bib) {
|
frr_each (bmp_imported_bgps, &bt->imported_bgps, bib) {
|
||||||
if (bgp_lookup_by_name(bib->name) != bgp)
|
if (bgp_lookup_by_name(bib->name) != bgp)
|
||||||
continue;
|
continue;
|
||||||
ret += bmp_bgp_attribute_updated_instance(bt, &bib->vrf_state, bgp,
|
bmp_bgp_attribute_updated_instance(bt, &bib->vrf_state, bgp,
|
||||||
withdraw, s);
|
withdraw, s);
|
||||||
if (withdraw)
|
if (withdraw)
|
||||||
continue;
|
continue;
|
||||||
frr_each (bmp_session, &bt->sessions, bmp) {
|
frr_each (bmp_session, &bt->sessions, bmp) {
|
||||||
|
|
|
@ -158,6 +158,14 @@
|
||||||
ctx->docstr_start = ctx->docstr;
|
ctx->docstr_start = ctx->docstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%{
|
||||||
|
#ifdef __clang__
|
||||||
|
# if __clang_major__ > 12
|
||||||
|
# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
%}
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
start:
|
start:
|
||||||
|
|
|
@ -306,8 +306,8 @@ static bool autorp_recv_announcement(struct pim_autorp *autorp, uint8_t rpcnt, u
|
||||||
/* Ignore RP's limited to PIM version 1 or with an unknown version */
|
/* Ignore RP's limited to PIM version 1 or with an unknown version */
|
||||||
if (rp->pimver == AUTORP_PIM_V1 || rp->pimver == AUTORP_PIM_VUNKNOWN) {
|
if (rp->pimver == AUTORP_PIM_V1 || rp->pimver == AUTORP_PIM_VUNKNOWN) {
|
||||||
if (PIM_DEBUG_AUTORP)
|
if (PIM_DEBUG_AUTORP)
|
||||||
zlog_debug("%s: Ignoring unsupported PIM version (%u) in AutoRP Announcement for RP %pI4",
|
zlog_debug("%s: Ignoring unsupported PIM version (%u) in AutoRP Announcement for RP %pPA",
|
||||||
__func__, rp->pimver, (in_addr_t *)&(rp->addr));
|
__func__, rp->pimver, &rp_addr);
|
||||||
/* Update the offset to skip past the groups advertised for this RP */
|
/* Update the offset to skip past the groups advertised for this RP */
|
||||||
offset += (AUTORP_GRPLEN * rp->grpcnt);
|
offset += (AUTORP_GRPLEN * rp->grpcnt);
|
||||||
continue;
|
continue;
|
||||||
|
@ -316,14 +316,14 @@ static bool autorp_recv_announcement(struct pim_autorp *autorp, uint8_t rpcnt, u
|
||||||
if (rp->grpcnt == 0) {
|
if (rp->grpcnt == 0) {
|
||||||
/* No groups?? */
|
/* No groups?? */
|
||||||
if (PIM_DEBUG_AUTORP)
|
if (PIM_DEBUG_AUTORP)
|
||||||
zlog_debug("%s: Announcement message has no groups for RP %pI4",
|
zlog_debug("%s: Announcement message has no groups for RP %pPA",
|
||||||
__func__, (in_addr_t *)&(rp->addr));
|
__func__, &rp_addr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((buf_size - offset) < AUTORP_GRPLEN) {
|
if ((buf_size - offset) < AUTORP_GRPLEN) {
|
||||||
zlog_warn("%s: Buffer underrun parsing groups for RP %pI4", __func__,
|
zlog_warn("%s: Buffer underrun parsing groups for RP %pPA", __func__,
|
||||||
(in_addr_t *)&(rp->addr));
|
&rp_addr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -794,14 +794,14 @@ static bool autorp_recv_discovery(struct pim_autorp *autorp, uint8_t rpcnt, uint
|
||||||
rp_addr.s_addr = rp->addr;
|
rp_addr.s_addr = rp->addr;
|
||||||
|
|
||||||
if (PIM_DEBUG_AUTORP)
|
if (PIM_DEBUG_AUTORP)
|
||||||
zlog_debug("%s: Parsing RP %pI4 (grpcnt=%u)", __func__,
|
zlog_debug("%s: Parsing RP %pPA (grpcnt=%u)", __func__, &rp_addr,
|
||||||
(in_addr_t *)&rp->addr, rp->grpcnt);
|
rp->grpcnt);
|
||||||
|
|
||||||
/* Ignore RP's limited to PIM version 1 or with an unknown version */
|
/* Ignore RP's limited to PIM version 1 or with an unknown version */
|
||||||
if (rp->pimver == AUTORP_PIM_V1 || rp->pimver == AUTORP_PIM_VUNKNOWN) {
|
if (rp->pimver == AUTORP_PIM_V1 || rp->pimver == AUTORP_PIM_VUNKNOWN) {
|
||||||
if (PIM_DEBUG_AUTORP)
|
if (PIM_DEBUG_AUTORP)
|
||||||
zlog_debug("%s: Ignoring unsupported PIM version in AutoRP Discovery for RP %pI4",
|
zlog_debug("%s: Ignoring unsupported PIM version in AutoRP Discovery for RP %pI4",
|
||||||
__func__, (in_addr_t *)&(rp->addr));
|
__func__, &rp_addr);
|
||||||
/* Update the offset to skip past the groups advertised for this RP */
|
/* Update the offset to skip past the groups advertised for this RP */
|
||||||
offset += (AUTORP_GRPLEN * rp->grpcnt);
|
offset += (AUTORP_GRPLEN * rp->grpcnt);
|
||||||
continue;
|
continue;
|
||||||
|
@ -810,17 +810,16 @@ static bool autorp_recv_discovery(struct pim_autorp *autorp, uint8_t rpcnt, uint
|
||||||
if (rp->grpcnt == 0) {
|
if (rp->grpcnt == 0) {
|
||||||
/* No groups?? */
|
/* No groups?? */
|
||||||
if (PIM_DEBUG_AUTORP)
|
if (PIM_DEBUG_AUTORP)
|
||||||
zlog_debug("%s: Discovery message has no groups for RP %pI4",
|
zlog_debug("%s: Discovery message has no groups for RP %pPA",
|
||||||
__func__, (in_addr_t *)&(rp->addr));
|
__func__, &rp_addr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure there is enough buffer to parse all the groups */
|
/* Make sure there is enough buffer to parse all the groups */
|
||||||
if ((buf_size - offset) < (AUTORP_GRPLEN * rp->grpcnt)) {
|
if ((buf_size - offset) < (AUTORP_GRPLEN * rp->grpcnt)) {
|
||||||
if (PIM_DEBUG_AUTORP)
|
if (PIM_DEBUG_AUTORP)
|
||||||
zlog_debug("%s: Buffer underrun parsing groups for RP %pI4 (%u < %u)",
|
zlog_debug("%s: Buffer underrun parsing groups for RP %pPA (%u < %u)",
|
||||||
__func__, (in_addr_t *)&(rp->addr),
|
__func__, &rp_addr, (uint32_t)(buf_size - offset),
|
||||||
(uint32_t)(buf_size - offset),
|
|
||||||
(uint32_t)(AUTORP_GRPLEN * rp->grpcnt));
|
(uint32_t)(AUTORP_GRPLEN * rp->grpcnt));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -838,8 +837,7 @@ static bool autorp_recv_discovery(struct pim_autorp *autorp, uint8_t rpcnt, uint
|
||||||
|
|
||||||
if (PIM_DEBUG_AUTORP)
|
if (PIM_DEBUG_AUTORP)
|
||||||
zlog_debug("%s: Parsing group %s%pFX for RP %pI4", __func__,
|
zlog_debug("%s: Parsing group %s%pFX for RP %pI4", __func__,
|
||||||
(grp->negprefix ? "!" : ""), &grppfix,
|
(grp->negprefix ? "!" : ""), &grppfix, &rp_addr);
|
||||||
(in_addr_t *)&rp->addr);
|
|
||||||
|
|
||||||
if (!pim_autorp_add_rp(autorp, rp_addr, grppfix, NULL, holdtime))
|
if (!pim_autorp_add_rp(autorp, rp_addr, grppfix, NULL, holdtime))
|
||||||
success = false;
|
success = false;
|
||||||
|
@ -885,9 +883,9 @@ static bool autorp_recv_discovery(struct pim_autorp *autorp, uint8_t rpcnt, uint
|
||||||
prefix_list_entry_update_finish(ple);
|
prefix_list_entry_update_finish(ple);
|
||||||
|
|
||||||
if (PIM_DEBUG_AUTORP)
|
if (PIM_DEBUG_AUTORP)
|
||||||
zlog_debug("%s: Parsing group %s%pFX for RP %pI4", __func__,
|
zlog_debug("%s: Parsing group %s%pFX for RP %pPA", __func__,
|
||||||
(grp->negprefix ? "!" : ""), &ple->prefix,
|
(grp->negprefix ? "!" : ""), &ple->prefix,
|
||||||
(in_addr_t *)&rp->addr);
|
&rp_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pim_autorp_add_rp(autorp, rp_addr, grppfix, plname, holdtime))
|
if (!pim_autorp_add_rp(autorp, rp_addr, grppfix, plname, holdtime))
|
||||||
|
|
|
@ -1562,8 +1562,7 @@ int pim_bsm_process(struct interface *ifp, pim_sgaddr *sg, uint8_t *buf,
|
||||||
(buf + PIM_BSM_HDR_LEN + PIM_MSG_HEADER_LEN),
|
(buf + PIM_BSM_HDR_LEN + PIM_MSG_HEADER_LEN),
|
||||||
(buf_size - PIM_BSM_HDR_LEN - PIM_MSG_HEADER_LEN),
|
(buf_size - PIM_BSM_HDR_LEN - PIM_MSG_HEADER_LEN),
|
||||||
frag_tag)) {
|
frag_tag)) {
|
||||||
zlog_warn("BSM from %pPA failed to parse",
|
zlog_warn("BSM from %pPA failed to parse", &bsr_addr);
|
||||||
(pim_addr *)&bshdr->bsr_addr.addr);
|
|
||||||
pim->bsm_dropped++;
|
pim->bsm_dropped++;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1802,7 +1801,7 @@ bool cand_addrsel_update(struct cand_addrsel *asel, struct vrf *vrf)
|
||||||
|
|
||||||
case CAND_ADDR_ANY:
|
case CAND_ADDR_ANY:
|
||||||
is_any = true;
|
is_any = true;
|
||||||
/* fallthru */
|
fallthrough;
|
||||||
case CAND_ADDR_LO:
|
case CAND_ADDR_LO:
|
||||||
FOR_ALL_INTERFACES (vrf, ifp) {
|
FOR_ALL_INTERFACES (vrf, ifp) {
|
||||||
if (!if_is_up(ifp))
|
if (!if_is_up(ifp))
|
||||||
|
|
|
@ -455,6 +455,8 @@ int pim_crp_process(struct interface *ifp, pim_sgaddr *src_dst, uint8_t *buf,
|
||||||
struct pim_interface *pim_ifp = NULL;
|
struct pim_interface *pim_ifp = NULL;
|
||||||
struct pim_instance *pim;
|
struct pim_instance *pim;
|
||||||
struct bsm_scope *scope;
|
struct bsm_scope *scope;
|
||||||
|
size_t ngroups;
|
||||||
|
pim_addr rpaddr = {};
|
||||||
|
|
||||||
pim_ifp = ifp->info;
|
pim_ifp = ifp->info;
|
||||||
if (!pim_ifp) {
|
if (!pim_ifp) {
|
||||||
|
@ -505,20 +507,19 @@ int pim_crp_process(struct interface *ifp, pim_sgaddr *src_dst, uint8_t *buf,
|
||||||
/* ignore trailing data */
|
/* ignore trailing data */
|
||||||
(void)buf;
|
(void)buf;
|
||||||
|
|
||||||
size_t ngroups = crp_hdr->prefix_cnt;
|
ngroups = crp_hdr->prefix_cnt;
|
||||||
|
rpaddr = crp_hdr->rp_addr.addr;
|
||||||
|
|
||||||
if (remain < ngroups * sizeof(struct pim_encoded_group_ipv4)) {
|
if (remain < ngroups * sizeof(struct pim_encoded_group_ipv4)) {
|
||||||
if (PIM_DEBUG_BSM)
|
if (PIM_DEBUG_BSM)
|
||||||
zlog_debug("truncated Candidate-RP advertisement for RP %pPA from %pPA (too short for %zu groups)",
|
zlog_debug("truncated Candidate-RP advertisement for RP %pPA from %pPA (too short for %zu groups)",
|
||||||
(pim_addr *)&crp_hdr->rp_addr.addr,
|
&rpaddr, &src_dst->src, ngroups);
|
||||||
&src_dst->src, ngroups);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PIM_DEBUG_BSM)
|
if (PIM_DEBUG_BSM)
|
||||||
zlog_debug("Candidate-RP: %pPA, prio=%u (from %pPA, %zu groups)",
|
zlog_debug("Candidate-RP: %pPA, prio=%u (from %pPA, %zu groups)",
|
||||||
(pim_addr *)&crp_hdr->rp_addr.addr, crp_hdr->rp_prio,
|
(pim_addr *)&rpaddr, crp_hdr->rp_prio, &src_dst->src, ngroups);
|
||||||
&src_dst->src, ngroups);
|
|
||||||
|
|
||||||
|
|
||||||
struct bsr_crp_rp *rp, ref;
|
struct bsr_crp_rp *rp, ref;
|
||||||
|
@ -529,16 +530,14 @@ int pim_crp_process(struct interface *ifp, pim_sgaddr *src_dst, uint8_t *buf,
|
||||||
if (!rp) {
|
if (!rp) {
|
||||||
if (bsr_crp_rps_count(scope->ebsr_rps) >= bsr_max_rps) {
|
if (bsr_crp_rps_count(scope->ebsr_rps) >= bsr_max_rps) {
|
||||||
zlog_err("BSR: number of tracked Candidate RPs (%zu) exceeds DoS-protection limit (%zu), dropping advertisement for RP %pPA (packet source %pPA)",
|
zlog_err("BSR: number of tracked Candidate RPs (%zu) exceeds DoS-protection limit (%zu), dropping advertisement for RP %pPA (packet source %pPA)",
|
||||||
bsr_crp_rps_count(scope->ebsr_rps),
|
bsr_crp_rps_count(scope->ebsr_rps), bsr_max_rps,
|
||||||
bsr_max_rps, (pim_addr *)&crp_hdr->rp_addr.addr,
|
(pim_addr *)&rpaddr, &src_dst->src);
|
||||||
&src_dst->src);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PIM_DEBUG_BSM)
|
if (PIM_DEBUG_BSM)
|
||||||
zlog_debug("new Candidate-RP: %pPA (from %pPA)",
|
zlog_debug("new Candidate-RP: %pPA (from %pPA)",
|
||||||
(pim_addr *)&crp_hdr->rp_addr.addr,
|
(pim_addr *)&rpaddr, &src_dst->src);
|
||||||
&src_dst->src);
|
|
||||||
|
|
||||||
rp = XCALLOC(MTYPE_PIM_BSR_CRP, sizeof(*rp));
|
rp = XCALLOC(MTYPE_PIM_BSR_CRP, sizeof(*rp));
|
||||||
rp->scope = scope;
|
rp->scope = scope;
|
||||||
|
|
Loading…
Reference in a new issue