summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-04-08 07:57:15 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2020-04-08 16:15:06 +0200
commitc4efd0f4235d1151a95add06ad5ccb42c7dcff21 (patch)
tree9aaff71f3b3ae6c23457092f6c78a25deec6adb7 /ospfd
parentMerge pull request #6180 from mjstapp/fix_bgp_ecomm_sa (diff)
downloadfrr-c4efd0f4235d1151a95add06ad5ccb42c7dcff21.tar.xz
frr-c4efd0f4235d1151a95add06ad5ccb42c7dcff21.zip
*: Do not cast to the same type
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_abr.c6
-rw-r--r--ospfd/ospf_ext.c4
-rw-r--r--ospfd/ospf_lsa.c9
-rw-r--r--ospfd/ospf_opaque.c2
-rw-r--r--ospfd/ospf_ri.c2
-rw-r--r--ospfd/ospf_sr.c8
-rw-r--r--ospfd/ospf_te.c2
-rw-r--r--ospfd/ospf_zebra.c4
-rw-r--r--ospfd/ospfd.c2
9 files changed, 18 insertions, 21 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index a8dfcbb36..eb3323997 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -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) {
diff --git a/ospfd/ospf_ext.c b/ospfd/ospf_ext.c
index df64fca88..47883d5f3 100644
--- a/ospfd/ospf_ext.c
+++ b/ospfd/ospf_ext.c
@@ -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;
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index d50f390e3..088f7f31c 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -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(
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index b042a0637..35fa5da74 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -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);
diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c
index fbe513cea..c3d53ad5e 100644
--- a/ospfd/ospf_ri.c
+++ b/ospfd/ospf_ri.c
@@ -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;
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c
index b5a54a0bc..7a786ba7a 100644
--- a/ospfd/ospf_sr.c
+++ b/ospfd/ospf_sr.c
@@ -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;
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index a2084e321..1009c7577 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -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,
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 385a7ece7..c7e6bd9cb 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -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);
}
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index f3fe9e17b..e9f622d21 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -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;