mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 18:10:23 +00:00
*: Do not cast to the same type
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
c446af503e
commit
c4efd0f423
@ -144,7 +144,7 @@ babel_send(int s,
|
||||
iovec[1].iov_base = buf2;
|
||||
iovec[1].iov_len = buflen2;
|
||||
memset(&msg, 0, sizeof(msg));
|
||||
msg.msg_name = (struct sockaddr*)sin;
|
||||
msg.msg_name = sin;
|
||||
msg.msg_namelen = slen;
|
||||
msg.msg_iov = iovec;
|
||||
msg.msg_iovlen = 2;
|
||||
|
@ -2178,8 +2178,7 @@ bgp_attr_large_community(struct bgp_attr_parser_args *args)
|
||||
args->total);
|
||||
}
|
||||
|
||||
attr->lcommunity =
|
||||
lcommunity_parse((uint8_t *)stream_pnt(peer->curr), length);
|
||||
attr->lcommunity = lcommunity_parse(stream_pnt(peer->curr), length);
|
||||
/* XXX: fix ecommunity_parse to use stream API */
|
||||
stream_forward_getp(peer->curr, length);
|
||||
|
||||
@ -2209,7 +2208,7 @@ bgp_attr_ext_communities(struct bgp_attr_parser_args *args)
|
||||
}
|
||||
|
||||
attr->ecommunity =
|
||||
ecommunity_parse((uint8_t *)stream_pnt(peer->curr), length);
|
||||
ecommunity_parse(stream_pnt(peer->curr), length);
|
||||
/* XXX: fix ecommunity_parse to use stream API */
|
||||
stream_forward_getp(peer->curr, length);
|
||||
|
||||
|
@ -558,7 +558,7 @@ char *community_str(struct community *com, bool make_json)
|
||||
hash package.*/
|
||||
unsigned int community_hash_make(const struct community *com)
|
||||
{
|
||||
uint32_t *pnt = (uint32_t *)com->val;
|
||||
uint32_t *pnt = com->val;
|
||||
|
||||
return jhash2(pnt, com->size, 0x43ea96c1);
|
||||
}
|
||||
|
@ -823,7 +823,7 @@ char *ecommunity_ecom2str(struct ecommunity *ecom, int format, int filter)
|
||||
if (sub_type == ECOMMUNITY_REDIRECT_VRF) {
|
||||
char buf[16] = {};
|
||||
ecommunity_rt_soo_str(
|
||||
buf, sizeof(buf), (uint8_t *)pnt,
|
||||
buf, sizeof(buf), pnt,
|
||||
type & ~ECOMMUNITY_ENCODE_TRANS_EXP,
|
||||
ECOMMUNITY_ROUTE_TARGET,
|
||||
ECOMMUNITY_FORMAT_DISPLAY);
|
||||
|
@ -901,8 +901,8 @@ static void add_mac_mobility_to_attr(uint32_t seq_num, struct attr *attr)
|
||||
if (type == ECOMMUNITY_ENCODE_EVPN
|
||||
&& sub_type
|
||||
== ECOMMUNITY_EVPN_SUBTYPE_MACMOBILITY) {
|
||||
ecom_val_ptr = (uint8_t *)(attr->ecommunity->val
|
||||
+ (i * 8));
|
||||
ecom_val_ptr =
|
||||
(attr->ecommunity->val + (i * 8));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2515,8 +2515,7 @@ static void evpn_show_route_rd_macip(struct vty *vty, struct bgp *bgp,
|
||||
return;
|
||||
}
|
||||
|
||||
bgp_evpn_route2str((struct prefix_evpn *)&p, prefix_str,
|
||||
sizeof(prefix_str));
|
||||
bgp_evpn_route2str(&p, prefix_str, sizeof(prefix_str));
|
||||
|
||||
/* Prefix and num paths displayed once per prefix. */
|
||||
route_vty_out_detail_header(vty, bgp, rn, prd, afi, safi, json);
|
||||
@ -2574,7 +2573,7 @@ static void evpn_show_route_rd(struct vty *vty, struct bgp *bgp,
|
||||
safi = SAFI_EVPN;
|
||||
prefix_cnt = path_cnt = 0;
|
||||
|
||||
prefix_rd2str((struct prefix_rd *)prd, rd_str, sizeof(rd_str));
|
||||
prefix_rd2str(prd, rd_str, sizeof(rd_str));
|
||||
|
||||
rd_rn = bgp_node_lookup(bgp->rib[afi][safi], (struct prefix *)prd);
|
||||
if (!rd_rn)
|
||||
|
@ -436,8 +436,7 @@ void bgp_connected_delete(struct bgp *bgp, struct connected *ifc)
|
||||
|
||||
bgp_address_del(bgp, ifc, addr);
|
||||
|
||||
rn = bgp_node_lookup(bgp->connected_table[AFI_IP6],
|
||||
(struct prefix *)&p);
|
||||
rn = bgp_node_lookup(bgp->connected_table[AFI_IP6], &p);
|
||||
}
|
||||
|
||||
if (!rn)
|
||||
|
@ -8298,7 +8298,7 @@ void route_vty_out_overlay(struct vty *vty, const struct prefix *p,
|
||||
mac = ecom_mac2str((char *)routermac->val);
|
||||
if (mac) {
|
||||
if (!json_path) {
|
||||
vty_out(vty, "/%s", (char *)mac);
|
||||
vty_out(vty, "/%s", mac);
|
||||
} else {
|
||||
json_object_string_add(json_overlay, "rmac",
|
||||
mac);
|
||||
@ -12268,7 +12268,7 @@ static int bgp_distance_set(struct vty *vty, const char *distance_str,
|
||||
distance = atoi(distance_str);
|
||||
|
||||
/* Get BGP distance node. */
|
||||
rn = bgp_node_get(bgp_distance_table[afi][safi], (struct prefix *)&p);
|
||||
rn = bgp_node_get(bgp_distance_table[afi][safi], &p);
|
||||
bdistance = bgp_node_get_bgp_distance_info(rn);
|
||||
if (bdistance)
|
||||
bgp_unlock_node(rn);
|
||||
@ -12309,8 +12309,7 @@ static int bgp_distance_unset(struct vty *vty, const char *distance_str,
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
|
||||
rn = bgp_node_lookup(bgp_distance_table[afi][safi],
|
||||
(struct prefix *)&p);
|
||||
rn = bgp_node_lookup(bgp_distance_table[afi][safi], &p);
|
||||
if (!rn) {
|
||||
vty_out(vty, "Can't find specified prefix\n");
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
|
@ -330,7 +330,7 @@ static uint8_t *bgpVersion(struct variable *v, oid name[], size_t *length,
|
||||
|
||||
/* Return octet string length 1. */
|
||||
*var_len = 1;
|
||||
return (uint8_t *)&version;
|
||||
return &version;
|
||||
}
|
||||
|
||||
static uint8_t *bgpLocalAs(struct variable *v, oid name[], size_t *length,
|
||||
|
@ -6173,8 +6173,7 @@ static void peer_aslist_update(const char *aslist_name)
|
||||
static void peer_aslist_add(char *aslist_name)
|
||||
{
|
||||
peer_aslist_update(aslist_name);
|
||||
route_map_notify_dependencies((char *)aslist_name,
|
||||
RMAP_EVENT_ASLIST_ADDED);
|
||||
route_map_notify_dependencies(aslist_name, RMAP_EVENT_ASLIST_ADDED);
|
||||
}
|
||||
|
||||
static void peer_aslist_del(const char *aslist_name)
|
||||
|
@ -2239,7 +2239,7 @@ static struct bgp_path_info *rfapiItBiIndexSearch(
|
||||
|
||||
bpi_fake.peer = peer;
|
||||
bpi_fake.extra = &bpi_extra;
|
||||
bpi_fake.extra->vnc.import.rd = *(struct prefix_rd *)prd;
|
||||
bpi_fake.extra->vnc.import.rd = *prd;
|
||||
if (aux_prefix) {
|
||||
bpi_fake.extra->vnc.import.aux_prefix = *aux_prefix;
|
||||
} else {
|
||||
|
@ -870,10 +870,9 @@ void rfapiMonitorItNodeChanged(
|
||||
if ((sl = RFAPI_MONITOR_ETH(rn))) {
|
||||
|
||||
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 (skiplist_search(nves_seen, m->rfd, NULL)) {
|
||||
/*
|
||||
|
@ -268,8 +268,8 @@ static void rfapi_info_free(struct rfapi_info *goner)
|
||||
if (goner->timer) {
|
||||
struct rfapi_rib_tcb *tcb;
|
||||
|
||||
tcb = ((struct thread *)goner->timer)->arg;
|
||||
thread_cancel((struct thread *)goner->timer);
|
||||
tcb = goner->timer->arg;
|
||||
thread_cancel(goner->timer);
|
||||
XFREE(MTYPE_RFAPI_RECENT_DELETE, tcb);
|
||||
goner->timer = NULL;
|
||||
}
|
||||
|
@ -3428,7 +3428,7 @@ static void clear_vnc_nve_closer(struct rfapi_local_reg_delete_arg *cda)
|
||||
&cursor)) {
|
||||
|
||||
if (pValue->rfd) {
|
||||
((struct rfapi_descriptor *)pValue->rfd)->flags |=
|
||||
pValue->rfd->flags |=
|
||||
RFAPI_HD_FLAG_CLOSING_ADMINISTRATIVELY;
|
||||
rfapi_close(pValue->rfd);
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ int eigrp_network_set(struct eigrp *eigrp, struct prefix *p)
|
||||
struct route_node *rn;
|
||||
struct interface *ifp;
|
||||
|
||||
rn = route_node_get(eigrp->networks, (struct prefix *)p);
|
||||
rn = route_node_get(eigrp->networks, p);
|
||||
if (rn->info) {
|
||||
/* There is already same network statement. */
|
||||
route_unlock_node(rn);
|
||||
|
@ -320,7 +320,7 @@ sock_set_md5sig(int fd, int af, union ldpd_addr *addr, const char *password)
|
||||
int
|
||||
sock_set_ipv4_tos(int fd, int tos)
|
||||
{
|
||||
if (setsockopt(fd, IPPROTO_IP, IP_TOS, (int *)&tos, sizeof(tos)) < 0) {
|
||||
if (setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) < 0) {
|
||||
log_warn("%s: error setting IP_TOS to 0x%x", __func__, tos);
|
||||
return (-1);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ enum matcher_rv command_match(struct graph *cmdgraph, vector vline,
|
||||
|
||||
// prepend a dummy token to match that pesky start node
|
||||
vector vvline = vector_init(vline->alloced + 1);
|
||||
vector_set_index(vvline, 0, (void *)XSTRDUP(MTYPE_TMP, "dummy"));
|
||||
vector_set_index(vvline, 0, XSTRDUP(MTYPE_TMP, "dummy"));
|
||||
memcpy(vvline->index + 1, vline->index,
|
||||
sizeof(void *) * vline->alloced);
|
||||
vvline->active = vline->active + 1;
|
||||
|
@ -429,7 +429,7 @@ void hmac_md5(unsigned char *text, int text_len, unsigned char *key,
|
||||
* pass */
|
||||
MD5Update(&context, k_ipad, 64); /* start with inner pad */
|
||||
MD5Update(&context, text, text_len); /* then text of datagram */
|
||||
MD5Final((uint8_t *)digest, &context); /* finish up 1st pass */
|
||||
MD5Final(digest, &context); /* finish up 1st pass */
|
||||
/*
|
||||
* perform outer MD5
|
||||
*/
|
||||
@ -438,5 +438,5 @@ void hmac_md5(unsigned char *text, int text_len, unsigned char *key,
|
||||
MD5Update(&context, k_opad, 64); /* start with outer pad */
|
||||
MD5Update(&context, digest, 16); /* then results of 1st
|
||||
* hash */
|
||||
MD5Final((uint8_t *)digest, &context); /* finish up 2nd pass */
|
||||
MD5Final(digest, &context); /* finish up 2nd pass */
|
||||
}
|
||||
|
@ -624,7 +624,7 @@ void skiplist_test(struct vty *vty)
|
||||
zlog_debug("%s: (%d:%d)", __func__, i, k);
|
||||
}
|
||||
// keys[k] = (void *)random();
|
||||
keys[k] = (void *)scramble(k);
|
||||
keys[k] = scramble(k);
|
||||
if (skiplist_insert(l, keys[k], keys[k]))
|
||||
zlog_debug("error in insert #%d,#%d", i, k);
|
||||
}
|
||||
@ -649,7 +649,7 @@ void skiplist_test(struct vty *vty)
|
||||
zlog_debug("<%d:%d>", i, k);
|
||||
if (skiplist_delete(l, keys[k], keys[k]))
|
||||
zlog_debug("error in delete");
|
||||
keys[k] = (void *)scramble(k ^ 0xf0f0f0f0);
|
||||
keys[k] = scramble(k ^ 0xf0f0f0f0);
|
||||
if (skiplist_insert(l, keys[k], keys[k]))
|
||||
zlog_debug("error in insert #%d,#%d", i, k);
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ static void route_common(const struct prefix *n, const struct prefix *p,
|
||||
np = (const uint8_t *)&n->u.prefix;
|
||||
pp = (const uint8_t *)&p->u.prefix;
|
||||
|
||||
newp = (uint8_t *)&new->u.prefix;
|
||||
newp = &new->u.prefix;
|
||||
|
||||
for (i = 0; i < p->prefixlen / 8; i++) {
|
||||
if (np[i] == pp[i])
|
||||
|
@ -116,7 +116,7 @@ static void vrf_update_vrf_id(ns_id_t ns_id, void *opaqueptr)
|
||||
vrf->vrf_id = vrf_id;
|
||||
RB_INSERT(vrf_id_head, &vrfs_by_id, vrf);
|
||||
if (old_vrf_id == VRF_UNKNOWN)
|
||||
vrf_enable((struct vrf *)vrf);
|
||||
vrf_enable(vrf);
|
||||
}
|
||||
|
||||
int vrf_switch_to_netns(vrf_id_t vrf_id)
|
||||
|
@ -990,7 +990,7 @@ int zapi_route_encode(uint8_t cmd, struct stream *s, struct zapi_route *api)
|
||||
stream_putc(s, api->prefix.family);
|
||||
psize = PSIZE(api->prefix.prefixlen);
|
||||
stream_putc(s, api->prefix.prefixlen);
|
||||
stream_write(s, (uint8_t *)&api->prefix.u.prefix, psize);
|
||||
stream_write(s, &api->prefix.u.prefix, psize);
|
||||
|
||||
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_SRCPFX)) {
|
||||
psize = PSIZE(api->src_prefix.prefixlen);
|
||||
|
@ -86,9 +86,9 @@ static inline void *__zbuf_pull(struct zbuf *zb, size_t size, int error)
|
||||
}
|
||||
|
||||
#define zbuf_pull(zb, type) ((type *)__zbuf_pull(zb, sizeof(type), 1))
|
||||
#define zbuf_pulln(zb, sz) ((void *)__zbuf_pull(zb, sz, 1))
|
||||
#define zbuf_pulln(zb, sz) (__zbuf_pull(zb, sz, 1))
|
||||
#define zbuf_may_pull(zb, type) ((type *)__zbuf_pull(zb, sizeof(type), 0))
|
||||
#define zbuf_may_pulln(zb, sz) ((void *)__zbuf_pull(zb, sz, 0))
|
||||
#define zbuf_may_pulln(zb, sz) (__zbuf_pull(zb, sz, 0))
|
||||
|
||||
void *zbuf_may_pull_until(struct zbuf *zb, const char *sep, struct zbuf *msg);
|
||||
|
||||
@ -149,9 +149,9 @@ static inline void *__zbuf_push(struct zbuf *zb, size_t size, int error)
|
||||
}
|
||||
|
||||
#define zbuf_push(zb, type) ((type *)__zbuf_push(zb, sizeof(type), 1))
|
||||
#define zbuf_pushn(zb, sz) ((void *)__zbuf_push(zb, sz, 1))
|
||||
#define zbuf_pushn(zb, sz) (__zbuf_push(zb, sz, 1))
|
||||
#define zbuf_may_push(zb, type) ((type *)__zbuf_may_push(zb, sizeof(type), 0))
|
||||
#define zbuf_may_pushn(zb, sz) ((void *)__zbuf_push(zb, sz, 0))
|
||||
#define zbuf_may_pushn(zb, sz) (__zbuf_push(zb, sz, 0))
|
||||
|
||||
static inline void zbuf_put(struct zbuf *zb, const void *src, size_t len)
|
||||
{
|
||||
|
@ -918,8 +918,8 @@ void ospf6_asbr_distribute_list_update(int type)
|
||||
ZROUTE_NAME(type));
|
||||
|
||||
ospf6->t_distribute_update = NULL;
|
||||
thread_add_timer_msec(master, ospf6_asbr_routemap_update_timer,
|
||||
(void **)args, OSPF_MIN_LS_INTERVAL,
|
||||
thread_add_timer_msec(master, ospf6_asbr_routemap_update_timer, args,
|
||||
OSPF_MIN_LS_INTERVAL,
|
||||
&ospf6->t_distribute_update);
|
||||
}
|
||||
|
||||
|
@ -527,7 +527,7 @@ struct ospf6_lsa *ospf6_lsa_create(struct ospf6_lsa_header *header)
|
||||
/* allocate memory */
|
||||
lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
|
||||
|
||||
lsa->header = (struct ospf6_lsa_header *)new_header;
|
||||
lsa->header = new_header;
|
||||
|
||||
/* dump string */
|
||||
ospf6_lsa_printbuf(lsa, lsa->name, sizeof(lsa->name));
|
||||
@ -554,7 +554,7 @@ struct ospf6_lsa *ospf6_lsa_create_headeronly(struct ospf6_lsa_header *header)
|
||||
/* allocate memory */
|
||||
lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
|
||||
|
||||
lsa->header = (struct ospf6_lsa_header *)new_header;
|
||||
lsa->header = new_header;
|
||||
SET_FLAG(lsa->flag, OSPF6_LSA_HEADERONLY);
|
||||
|
||||
/* dump string */
|
||||
|
@ -989,7 +989,7 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
|
||||
rtr_lsa = ospf6_lsdb_next(end, rtr_lsa);
|
||||
continue;
|
||||
}
|
||||
lsa_header = (struct ospf6_lsa_header *)rtr_lsa->header;
|
||||
lsa_header = rtr_lsa->header;
|
||||
total_lsa_length += (ntohs(lsa_header->length) - lsa_length);
|
||||
num_lsa++;
|
||||
rtr_lsa = ospf6_lsdb_next(end, rtr_lsa);
|
||||
@ -1027,7 +1027,7 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
|
||||
assert(rtr_lsa);
|
||||
if (!OSPF6_LSA_IS_MAXAGE(rtr_lsa)) {
|
||||
/* Append first Link State ID LSA */
|
||||
lsa_header = (struct ospf6_lsa_header *)rtr_lsa->header;
|
||||
lsa_header = rtr_lsa->header;
|
||||
memcpy(new_header, lsa_header, ntohs(lsa_header->length));
|
||||
/* Assign new lsa length as aggregated length. */
|
||||
((struct ospf6_lsa_header *)new_header)->length =
|
||||
@ -1057,7 +1057,7 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
|
||||
}
|
||||
|
||||
/* Append Next Link State ID LSA */
|
||||
lsa_header = (struct ospf6_lsa_header *)rtr_lsa->header;
|
||||
lsa_header = rtr_lsa->header;
|
||||
memcpy(new_header, (OSPF6_LSA_HEADER_END(rtr_lsa->header) + 4),
|
||||
(ntohs(lsa_header->length) - lsa_length));
|
||||
new_header += (ntohs(lsa_header->length) - lsa_length);
|
||||
|
@ -171,8 +171,8 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
|
||||
|
||||
if (IS_OSPF6_DEBUG_ZEBRA(RECV)) {
|
||||
char prefixstr[PREFIX2STR_BUFFER], nexthopstr[128];
|
||||
prefix2str((struct prefix *)&api.prefix, prefixstr,
|
||||
sizeof(prefixstr));
|
||||
|
||||
prefix2str(&api.prefix, prefixstr, sizeof(prefixstr));
|
||||
inet_ntop(AF_INET6, nexthop, nexthopstr, sizeof(nexthopstr));
|
||||
|
||||
zlog_debug(
|
||||
|
@ -708,8 +708,7 @@ void ospf_abr_announce_network_to_area(struct prefix_ipv4 *p, uint32_t cost,
|
||||
else
|
||||
full_cost = cost;
|
||||
|
||||
old = ospf_lsa_lookup_by_prefix(area->lsdb, OSPF_SUMMARY_LSA,
|
||||
(struct prefix_ipv4 *)p,
|
||||
old = ospf_lsa_lookup_by_prefix(area->lsdb, OSPF_SUMMARY_LSA, p,
|
||||
area->ospf->router_id);
|
||||
if (old) {
|
||||
if (IS_DEBUG_OSPF_EVENT)
|
||||
@ -761,8 +760,7 @@ void ospf_abr_announce_network_to_area(struct prefix_ipv4 *p, uint32_t cost,
|
||||
zlog_debug(
|
||||
"ospf_abr_announce_network_to_area(): "
|
||||
"creating new summary");
|
||||
lsa = ospf_summary_lsa_originate((struct prefix_ipv4 *)p,
|
||||
full_cost, area);
|
||||
lsa = ospf_summary_lsa_originate(p, full_cost, area);
|
||||
/* This will flood through area. */
|
||||
|
||||
if (!lsa) {
|
||||
|
@ -1684,7 +1684,7 @@ static uint16_t show_vty_link_info(struct vty *vty, struct tlv_header *ext)
|
||||
/* Extended Link TLVs */
|
||||
static void ospf_ext_link_show_info(struct vty *vty, struct ospf_lsa *lsa)
|
||||
{
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
struct tlv_header *tlvh;
|
||||
uint16_t length = 0, sum = 0;
|
||||
|
||||
@ -1758,7 +1758,7 @@ static uint16_t show_vty_pref_info(struct vty *vty, struct tlv_header *ext)
|
||||
/* Extended Prefix TLVs */
|
||||
static void ospf_ext_pref_show_info(struct vty *vty, struct ospf_lsa *lsa)
|
||||
{
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
struct tlv_header *tlvh;
|
||||
uint16_t length = 0, sum = 0;
|
||||
|
||||
|
@ -123,7 +123,7 @@ int get_age(struct ospf_lsa *lsa)
|
||||
one-based. */
|
||||
uint16_t ospf_lsa_checksum(struct lsa_header *lsa)
|
||||
{
|
||||
uint8_t *buffer = (uint8_t *)&lsa->options;
|
||||
uint8_t *buffer = &lsa->options;
|
||||
int options_offset = buffer - (uint8_t *)&lsa->ls_age; /* should be 2 */
|
||||
|
||||
/* Skip the AGE field */
|
||||
@ -138,7 +138,7 @@ uint16_t ospf_lsa_checksum(struct lsa_header *lsa)
|
||||
|
||||
int ospf_lsa_checksum_valid(struct lsa_header *lsa)
|
||||
{
|
||||
uint8_t *buffer = (uint8_t *)&lsa->options;
|
||||
uint8_t *buffer = &lsa->options;
|
||||
int options_offset = buffer - (uint8_t *)&lsa->ls_age; /* should be 2 */
|
||||
|
||||
/* Skip the AGE field */
|
||||
@ -2845,8 +2845,7 @@ void ospf_lsa_maxage_delete(struct ospf *ospf, struct ospf_lsa *lsa)
|
||||
lsa_prefix.prefixlen = sizeof(lsa_prefix.u.ptr) * CHAR_BIT;
|
||||
lsa_prefix.u.ptr = (uintptr_t)lsa;
|
||||
|
||||
if ((rn = route_node_lookup(ospf->maxage_lsa,
|
||||
(struct prefix *)&lsa_prefix))) {
|
||||
if ((rn = route_node_lookup(ospf->maxage_lsa, &lsa_prefix))) {
|
||||
if (rn->info == lsa) {
|
||||
UNSET_FLAG(lsa->flags, OSPF_LSA_IN_MAXAGE);
|
||||
ospf_lsa_unlock(&lsa); /* maxage_lsa */
|
||||
@ -2888,7 +2887,7 @@ void ospf_lsa_maxage(struct ospf *ospf, struct ospf_lsa *lsa)
|
||||
lsa_prefix.prefixlen = sizeof(lsa_prefix.u.ptr) * CHAR_BIT;
|
||||
lsa_prefix.u.ptr = (uintptr_t)lsa;
|
||||
|
||||
rn = route_node_get(ospf->maxage_lsa, (struct prefix *)&lsa_prefix);
|
||||
rn = route_node_get(ospf->maxage_lsa, &lsa_prefix);
|
||||
if (rn->info != NULL) {
|
||||
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
|
||||
zlog_debug(
|
||||
|
@ -1161,7 +1161,7 @@ void ospf_opaque_config_write_debug(struct vty *vty)
|
||||
|
||||
void show_opaque_info_detail(struct vty *vty, struct ospf_lsa *lsa)
|
||||
{
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
uint32_t lsid = ntohl(lsah->id.s_addr);
|
||||
uint8_t opaque_type = GET_OPAQUE_TYPE(lsid);
|
||||
uint32_t opaque_id = GET_OPAQUE_ID(lsid);
|
||||
|
@ -1438,7 +1438,7 @@ static uint16_t show_vty_sr_msd(struct vty *vty, struct tlv_header *tlvh)
|
||||
|
||||
static void ospf_router_info_show_info(struct vty *vty, struct ospf_lsa *lsa)
|
||||
{
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
struct tlv_header *tlvh;
|
||||
uint16_t length = 0, sum = 0;
|
||||
|
||||
|
@ -1035,7 +1035,7 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
|
||||
{
|
||||
struct sr_node *srn;
|
||||
struct tlv_header *tlvh;
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
struct ri_sr_tlv_sid_label_range *ri_srgb;
|
||||
struct ri_sr_tlv_sr_algorithm *algo;
|
||||
struct sr_srgb srgb;
|
||||
@ -1156,7 +1156,7 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
|
||||
void ospf_sr_ri_lsa_delete(struct ospf_lsa *lsa)
|
||||
{
|
||||
struct sr_node *srn;
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
|
||||
if (IS_DEBUG_OSPF_SR)
|
||||
zlog_debug("SR (%s): Remove SR node %s from lsa_id 4.0.0.%u",
|
||||
@ -1198,7 +1198,7 @@ void ospf_sr_ext_link_lsa_update(struct ospf_lsa *lsa)
|
||||
{
|
||||
struct sr_node *srn;
|
||||
struct tlv_header *tlvh;
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
struct sr_link *srl;
|
||||
|
||||
uint16_t length, sum;
|
||||
@ -1308,7 +1308,7 @@ void ospf_sr_ext_prefix_lsa_update(struct ospf_lsa *lsa)
|
||||
{
|
||||
struct sr_node *srn;
|
||||
struct tlv_header *tlvh;
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
struct sr_prefix *srp;
|
||||
|
||||
uint16_t length, sum;
|
||||
|
@ -2119,7 +2119,7 @@ static uint16_t ospf_mpls_te_show_link_subtlv(struct vty *vty,
|
||||
|
||||
static void ospf_mpls_te_show_info(struct vty *vty, struct ospf_lsa *lsa)
|
||||
{
|
||||
struct lsa_header *lsah = (struct lsa_header *)lsa->data;
|
||||
struct lsa_header *lsah = lsa->data;
|
||||
struct tlv_header *tlvh, *next;
|
||||
uint16_t sum, total;
|
||||
uint16_t (*subfunc)(struct vty * vty, struct tlv_header * tlvh,
|
||||
|
@ -1023,8 +1023,8 @@ void ospf_distribute_list_update(struct ospf *ospf, int type,
|
||||
|
||||
/* Set timer. */
|
||||
ospf->t_distribute_update = NULL;
|
||||
thread_add_timer_msec(master, ospf_distribute_list_update_timer,
|
||||
(void **)args, ospf->min_ls_interval,
|
||||
thread_add_timer_msec(master, ospf_distribute_list_update_timer, args,
|
||||
ospf->min_ls_interval,
|
||||
&ospf->t_distribute_update);
|
||||
}
|
||||
|
||||
|
@ -1787,7 +1787,7 @@ static void ospf_nbr_nbma_add(struct ospf_nbr_nbma *nbr_nbma,
|
||||
p.prefixlen = IPV4_MAX_BITLEN;
|
||||
p.u.prefix4 = nbr_nbma->addr;
|
||||
|
||||
rn = route_node_get(oi->nbrs, (struct prefix *)&p);
|
||||
rn = route_node_get(oi->nbrs, &p);
|
||||
if (rn->info) {
|
||||
nbr = rn->info;
|
||||
nbr->nbr_nbma = nbr_nbma;
|
||||
|
@ -47,7 +47,7 @@ void pim_bfd_write_config(struct vty *vty, struct interface *ifp)
|
||||
if (!pim_ifp)
|
||||
return;
|
||||
|
||||
bfd_info = (struct bfd_info *)pim_ifp->bfd_info;
|
||||
bfd_info = pim_ifp->bfd_info;
|
||||
if (!bfd_info)
|
||||
return;
|
||||
|
||||
@ -92,7 +92,7 @@ void pim_bfd_info_nbr_create(struct pim_interface *pim_ifp,
|
||||
if (!neigh->bfd_info)
|
||||
return;
|
||||
|
||||
nbr_bfd_info = (struct bfd_info *)neigh->bfd_info;
|
||||
nbr_bfd_info = neigh->bfd_info;
|
||||
nbr_bfd_info->detect_mult = pim_ifp->bfd_info->detect_mult;
|
||||
nbr_bfd_info->desired_min_tx = pim_ifp->bfd_info->desired_min_tx;
|
||||
nbr_bfd_info->required_min_rx = pim_ifp->bfd_info->required_min_rx;
|
||||
@ -118,7 +118,7 @@ static void pim_bfd_reg_dereg_nbr(struct pim_neighbor *nbr, int command)
|
||||
if (!nbr)
|
||||
return;
|
||||
pim_ifp = nbr->interface->info;
|
||||
bfd_info = (struct bfd_info *)pim_ifp->bfd_info;
|
||||
bfd_info = pim_ifp->bfd_info;
|
||||
if (!bfd_info)
|
||||
return;
|
||||
if (PIM_DEBUG_PIM_TRACE) {
|
||||
@ -194,8 +194,8 @@ void pim_bfd_if_param_set(struct interface *ifp, uint32_t min_rx,
|
||||
|
||||
if (!pim_ifp)
|
||||
return;
|
||||
bfd_set_param((struct bfd_info **)&(pim_ifp->bfd_info), min_rx, min_tx,
|
||||
detect_mult, defaults, &command);
|
||||
bfd_set_param(&(pim_ifp->bfd_info), min_rx, min_tx, detect_mult,
|
||||
defaults, &command);
|
||||
|
||||
if (pim_ifp->bfd_info) {
|
||||
if (PIM_DEBUG_PIM_TRACE)
|
||||
|
@ -484,7 +484,7 @@ int pim_hello_build_tlv(struct interface *ifp, uint8_t *tlv_buf,
|
||||
return -1;
|
||||
}
|
||||
if (can_disable_join_suppression) {
|
||||
*((uint8_t *)(curr) + 4) |= 0x80; /* enable T bit */
|
||||
*(curr + 4) |= 0x80; /* enable T bit */
|
||||
}
|
||||
curr = tmp;
|
||||
|
||||
|
@ -375,8 +375,7 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
|
||||
struct in_pktinfo *i =
|
||||
(struct in_pktinfo *)CMSG_DATA(cmsg);
|
||||
if (to)
|
||||
((struct sockaddr_in *)to)->sin_addr =
|
||||
i->ipi_addr;
|
||||
to->sin_addr = i->ipi_addr;
|
||||
if (tolen)
|
||||
*tolen = sizeof(struct sockaddr_in);
|
||||
if (ifindex)
|
||||
@ -391,7 +390,7 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
|
||||
&& (cmsg->cmsg_type == IP_RECVDSTADDR)) {
|
||||
struct in_addr *i = (struct in_addr *)CMSG_DATA(cmsg);
|
||||
if (to)
|
||||
((struct sockaddr_in *)to)->sin_addr = *i;
|
||||
to->sin_addr = *i;
|
||||
if (tolen)
|
||||
*tolen = sizeof(struct sockaddr_in);
|
||||
|
||||
|
@ -121,20 +121,19 @@ int pim_encode_addr_ucast(uint8_t *buf, struct prefix *p)
|
||||
{
|
||||
switch (p->family) {
|
||||
case AF_INET:
|
||||
*(uint8_t *)buf =
|
||||
PIM_MSG_ADDRESS_FAMILY_IPV4; /* notice: AF_INET !=
|
||||
PIM_MSG_ADDRESS_FAMILY_IPV4
|
||||
*/
|
||||
*buf = PIM_MSG_ADDRESS_FAMILY_IPV4; /* notice: AF_INET !=
|
||||
PIM_MSG_ADDRESS_FAMILY_IPV4
|
||||
*/
|
||||
++buf;
|
||||
*(uint8_t *)buf = 0; /* ucast IPv4 native encoding type (RFC
|
||||
*buf = 0; /* ucast IPv4 native encoding type (RFC
|
||||
4601: 4.9.1) */
|
||||
++buf;
|
||||
memcpy(buf, &p->u.prefix4, sizeof(struct in_addr));
|
||||
return ucast_ipv4_encoding_len;
|
||||
case AF_INET6:
|
||||
*(uint8_t *)buf = PIM_MSG_ADDRESS_FAMILY_IPV6;
|
||||
*buf = PIM_MSG_ADDRESS_FAMILY_IPV6;
|
||||
++buf;
|
||||
*(uint8_t *)buf = 0;
|
||||
*buf = 0;
|
||||
++buf;
|
||||
memcpy(buf, &p->u.prefix6, sizeof(struct in6_addr));
|
||||
return ucast_ipv6_encoding_len;
|
||||
@ -198,13 +197,13 @@ int pim_encode_addr_group(uint8_t *buf, afi_t afi, int bidir, int scope,
|
||||
|
||||
switch (afi) {
|
||||
case AFI_IP:
|
||||
*(uint8_t *)buf = PIM_MSG_ADDRESS_FAMILY_IPV4;
|
||||
*buf = PIM_MSG_ADDRESS_FAMILY_IPV4;
|
||||
++buf;
|
||||
*(uint8_t *)buf = 0;
|
||||
*buf = 0;
|
||||
++buf;
|
||||
*(uint8_t *)buf = flags;
|
||||
*buf = flags;
|
||||
++buf;
|
||||
*(uint8_t *)buf = 32;
|
||||
*buf = 32;
|
||||
++buf;
|
||||
memcpy(buf, &group, sizeof(struct in_addr));
|
||||
return group_ipv4_encoding_len;
|
||||
|
@ -391,8 +391,7 @@ static void test_state_del_one_route(struct test_state *test, struct prng *prng)
|
||||
}
|
||||
|
||||
assert(rn);
|
||||
srcdest_rnode_prefixes(rn, (const struct prefix **)&dst_p,
|
||||
(const struct prefix **)&src_p);
|
||||
srcdest_rnode_prefixes(rn, &dst_p, &src_p);
|
||||
memcpy(&dst6_p, dst_p, sizeof(dst6_p));
|
||||
if (src_p)
|
||||
memcpy(&src6_p, src_p, sizeof(src6_p));
|
||||
|
@ -235,7 +235,7 @@ static const char *next_dirname(const char *s)
|
||||
{
|
||||
const char *cur;
|
||||
|
||||
cur = (const char *)s;
|
||||
cur = s;
|
||||
|
||||
if (*cur != '\0') {
|
||||
for (; *cur != '/'; ++cur)
|
||||
@ -255,7 +255,7 @@ static void add_namespace(const char *path)
|
||||
const char *nsdirname, *nsname, *cur;
|
||||
struct namespace *namespace;
|
||||
|
||||
cur = (const char *)path;
|
||||
cur = path;
|
||||
nsdirname = nsname = "";
|
||||
|
||||
while ((cur = next_dirname(cur))[0] != '\0') {
|
||||
@ -273,7 +273,7 @@ static void add_namespace(const char *path)
|
||||
badusage("invalid namepspace path");
|
||||
|
||||
namespace = xmalloc(sizeof(*namespace));
|
||||
namespace->path = (const char *)path;
|
||||
namespace->path = path;
|
||||
namespace->nstype = nstype;
|
||||
LIST_INSERT_HEAD(&namespace_head, namespace, list);
|
||||
}
|
||||
|
@ -83,8 +83,7 @@ static int vrrp_ndisc_una_build(struct interface *ifp, struct ipaddr *ip,
|
||||
struct nd_opt_hdr *nd_opt_h =
|
||||
(struct nd_opt_hdr *)((char *)ndh
|
||||
+ sizeof(struct nd_neighbor_advert));
|
||||
char *nd_opt_lladdr =
|
||||
(char *)((char *)nd_opt_h + sizeof(struct nd_opt_hdr));
|
||||
char *nd_opt_lladdr = ((char *)nd_opt_h + sizeof(struct nd_opt_hdr));
|
||||
char *lladdr = (char *)ifp->hw_addr;
|
||||
|
||||
/*
|
||||
|
@ -294,7 +294,7 @@ int zfpm_protobuf_encode_route(rib_dest_t *dest, struct route_entry *re,
|
||||
return 0;
|
||||
}
|
||||
|
||||
len = fpm__message__pack(msg, (uint8_t *)in_buf);
|
||||
len = fpm__message__pack(msg, in_buf);
|
||||
assert(len <= in_buf_len);
|
||||
|
||||
QPB_RESET_STACK_ALLOCATOR(allocator);
|
||||
|
@ -143,7 +143,7 @@ static ns_id_t extract_nsid(struct nlmsghdr *nlh, char *buf)
|
||||
void *tail = (void *)((char *)nlh + NETLINK_ALIGN(nlh->nlmsg_len));
|
||||
struct nlattr *attr;
|
||||
|
||||
for (attr = (struct nlattr *)((char *)buf + offset);
|
||||
for (attr = (struct nlattr *)(buf + offset);
|
||||
NETLINK_NLATTR_LEN(tail, attr) >= sizeof(struct nlattr)
|
||||
&& attr->nla_len >= sizeof(struct nlattr)
|
||||
&& attr->nla_len <= NETLINK_NLATTR_LEN(tail, attr);
|
||||
|
@ -261,7 +261,7 @@ struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
|
||||
p.prefixlen = IPV6_MAX_PREFIXLEN;
|
||||
}
|
||||
|
||||
rn = route_node_match(table, (struct prefix *)&p);
|
||||
rn = route_node_match(table, &p);
|
||||
|
||||
while (rn) {
|
||||
rib_dest_t *dest;
|
||||
|
@ -1515,8 +1515,8 @@ static void zvni_print_mac_hash_all_vni(struct hash_bucket *bucket, void *ctxt)
|
||||
struct mac_walk_ctx *wctx = ctxt;
|
||||
char vni_str[VNI_STR_LEN];
|
||||
|
||||
vty = (struct vty *)wctx->vty;
|
||||
json = (struct json_object *)wctx->json;
|
||||
vty = wctx->vty;
|
||||
json = wctx->json;
|
||||
|
||||
zvni = (zebra_vni_t *)bucket->data;
|
||||
wctx->zvni = zvni;
|
||||
@ -1586,8 +1586,8 @@ static void zvni_print_mac_hash_all_vni_detail(struct hash_bucket *bucket,
|
||||
struct mac_walk_ctx *wctx = ctxt;
|
||||
char vni_str[VNI_STR_LEN];
|
||||
|
||||
vty = (struct vty *)wctx->vty;
|
||||
json = (struct json_object *)wctx->json;
|
||||
vty = wctx->vty;
|
||||
json = wctx->json;
|
||||
|
||||
zvni = (zebra_vni_t *)bucket->data;
|
||||
if (!zvni) {
|
||||
@ -3691,7 +3691,7 @@ static struct interface *zvni_map_to_svi(vlanid_t vid, struct interface *br_if)
|
||||
if (!zif || zif->zif_type != ZEBRA_IF_VLAN
|
||||
|| zif->link != br_if)
|
||||
continue;
|
||||
vl = (struct zebra_l2info_vlan *)&zif->l2info.vl;
|
||||
vl = &zif->l2info.vl;
|
||||
|
||||
if (vl->vid == vid) {
|
||||
found = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user