Merge pull request #11163 from opensourcerouting/fix/same_type_casting

*: Avoid casting to the same type as on the left
This commit is contained in:
Igor Ryzhov 2022-05-10 00:16:30 +03:00 committed by GitHub
commit 2a3807c3ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 21 additions and 27 deletions

View File

@ -396,8 +396,7 @@ void bgp_connected_add(struct bgp *bgp, struct connected *ifc)
bgp_address_add(bgp, ifc, addr);
dest = bgp_node_get(bgp->connected_table[AFI_IP],
(struct prefix *)&p);
dest = bgp_node_get(bgp->connected_table[AFI_IP], &p);
bc = bgp_dest_get_bgp_connected_ref_info(dest);
if (bc)
bc->refcnt++;
@ -430,8 +429,7 @@ void bgp_connected_add(struct bgp *bgp, struct connected *ifc)
bgp_address_add(bgp, ifc, addr);
dest = bgp_node_get(bgp->connected_table[AFI_IP6],
(struct prefix *)&p);
dest = bgp_node_get(bgp->connected_table[AFI_IP6], &p);
bc = bgp_dest_get_bgp_connected_ref_info(dest);
if (bc)

View File

@ -2108,10 +2108,9 @@ void rfapiRibPendingDeleteRoute(struct bgp *bgp, struct rfapi_import_table *it,
sl);
for (cursor = NULL,
rc = skiplist_next(sl, NULL, (void **)&m,
(void **)&cursor);
rc = skiplist_next(sl, NULL, (void **)&m, &cursor);
!rc; rc = skiplist_next(sl, NULL, (void **)&m,
(void **)&cursor)) {
&cursor)) {
#if DEBUG_PENDING_DELETE_ROUTE
vnc_zlog_debug_verbose("%s: eth monitor rfd=%p",

View File

@ -706,7 +706,7 @@ static void process_N(struct isis_spftree *spftree, enum vertextype vtype,
if (vtype >= VTYPE_IPREACH_INTERNAL) {
memcpy(&p, id, sizeof(p));
apply_mask(&p.dest);
apply_mask((struct prefix *)&p.src);
apply_mask(&p.src);
id = &p;
}

View File

@ -1761,8 +1761,8 @@ bool ospf6_is_valid_summary_addr(struct vty *vty, struct prefix *p)
memset(&addr_zero, 0, sizeof(struct in6_addr));
/* Default prefix validation*/
if ((is_default_prefix((struct prefix *)p))
|| (!memcmp(&p->u.prefix6, &addr_zero, sizeof(struct in6_addr)))) {
if ((is_default_prefix(p)) ||
(!memcmp(&p->u.prefix6, &addr_zero, sizeof(struct in6_addr)))) {
vty_out(vty, "Default address should not be configured as summary address.\n");
return false;
}
@ -1802,7 +1802,7 @@ DEFPY (ospf6_external_route_aggregation,
}
/* Apply mask for given prefix. */
apply_mask((struct prefix *)&p);
apply_mask(&p);
if (!ospf6_is_valid_summary_addr(vty, &p))
return CMD_WARNING_CONFIG_FAILED;
@ -1850,7 +1850,7 @@ DEFPY(no_ospf6_external_route_aggregation,
}
/* Apply mask for given prefix. */
apply_mask((struct prefix *)&p);
apply_mask(&p);
if (!ospf6_is_valid_summary_addr(vty, &p))
return CMD_WARNING_CONFIG_FAILED;
@ -1881,7 +1881,7 @@ DEFPY (ospf6_external_route_aggregation_no_advertise,
}
/* Apply mask for given prefix. */
apply_mask((struct prefix *)&p);
apply_mask(&p);
if (!ospf6_is_valid_summary_addr(vty, &p))
return CMD_WARNING_CONFIG_FAILED;
@ -1913,7 +1913,7 @@ DEFPY (no_ospf6_external_route_aggregation_no_advertise,
}
/* Apply mask for given prefix. */
apply_mask((struct prefix *)&p);
apply_mask(&p);
if (!ospf6_is_valid_summary_addr(vty, &p))
return CMD_WARNING_CONFIG_FAILED;

View File

@ -326,7 +326,7 @@ void ospf_ldp_sync_if_remove(struct interface *ifp, bool remove)
if (!CHECK_FLAG(ldp_sync_info->flags, LDP_SYNC_FLAG_IF_CONFIG))
ldp_sync_info->enabled = LDP_IGP_SYNC_DEFAULT;
if (remove) {
ldp_sync_info_free((struct ldp_sync_info **)&(ldp_sync_info));
ldp_sync_info_free(&ldp_sync_info);
params->ldp_sync_info = NULL;
}
}

View File

@ -10036,7 +10036,7 @@ DEFUN (ospf_external_route_aggregation,
}
/* Apply mask for given prefix. */
apply_mask((struct prefix *)&p);
apply_mask(&p);
if (!is_valid_summary_addr(&p)) {
vty_out(vty, "Not a valid summary address.\n");
@ -10077,7 +10077,7 @@ DEFUN (no_ospf_external_route_aggregation,
}
/* Apply mask for given prefix. */
apply_mask((struct prefix *)&p);
apply_mask(&p);
if (!is_valid_summary_addr(&p)) {
vty_out(vty, "Not a valid summary address.\n");
@ -10377,7 +10377,7 @@ DEFUN (ospf_external_route_aggregation_no_adrvertise,
}
/* Apply mask for given prefix. */
apply_mask((struct prefix *)&p);
apply_mask(&p);
if (!is_valid_summary_addr(&p)) {
vty_out(vty, "Not a valid summary address.\n");
@ -10413,7 +10413,7 @@ DEFUN (no_ospf_external_route_aggregation_no_adrvertise,
}
/* Apply mask for given prefix. */
apply_mask((struct prefix *)&p);
apply_mask(&p);
if (!is_valid_summary_addr(&p)) {
vty_out(vty, "Not a valid summary address.\n");

View File

@ -1185,8 +1185,7 @@ pcep_decode_tlv_pol_id(struct pcep_object_tlv_header *tlv_hdr,
return (struct pcep_object_tlv_header *)ipv4;
} else {
ipv4->is_ipv4 = false;
struct pcep_object_tlv_srpag_pol_id *ipv6 =
(struct pcep_object_tlv_srpag_pol_id *)ipv4;
struct pcep_object_tlv_srpag_pol_id *ipv6 = ipv4;
ipv6->color = ntohl(uint32_ptr[0]);
decode_ipv6(&uint32_ptr[1], &ipv6->end_point.ipv6);
return (struct pcep_object_tlv_header *)ipv6;

View File

@ -217,7 +217,7 @@ int ripng_send_packet(caddr_t buf, int bufsize, struct sockaddr_in6 *to,
msg.msg_namelen = sizeof(struct sockaddr_in6);
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = (void *)adata;
msg.msg_control = adata;
msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo));
iov.iov_base = buf;

View File

@ -328,7 +328,7 @@ static void get_rand_prefix(struct prng *prng, struct prefix_ipv6 *p)
p->prefixlen = prng_rand(prng) % 129;
p->family = AF_INET6;
apply_mask((struct prefix *)p);
apply_mask(p);
}
static void get_rand_prefix_pair(struct prng *prng, struct prefix_ipv6 *dst_p,

View File

@ -248,7 +248,7 @@ lib_vrf_zebra_ribs_rib_route_get_next(struct nb_cb_get_next_args *args)
if (args->list_entry == NULL)
rn = route_top(zrt->table);
else
rn = srcdest_route_next((struct route_node *)rn);
rn = srcdest_route_next(rn);
/* Optimization: skip empty route nodes. */
while (rn && rn->info == NULL)
rn = route_next(rn);

View File

@ -1078,9 +1078,7 @@ static int zevpn_build_hash_table_zns(struct ns *ns,
static void zevpn_build_hash_table(void)
{
ns_walk_func(zevpn_build_hash_table_zns,
(void *)NULL,
(void **)NULL);
ns_walk_func(zevpn_build_hash_table_zns, NULL, NULL);
}
/*