From df5dfb77b5c38fc1c5b242b3df1f4bc9b3e02869 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 23 Apr 2021 11:23:57 +0200 Subject: [PATCH] pimd: zassert => assert No point in having pimd use zassert() while everything else uses plain assert(). Signed-off-by: David Lamparter --- pimd/pim_assert.c | 2 +- pimd/pim_hello.c | 8 +++---- pimd/pim_iface.c | 42 +++++++++++++++++------------------ pimd/pim_ifchannel.c | 10 ++++----- pimd/pim_igmp.c | 46 +++++++++++++++++++-------------------- pimd/pim_igmpv2.c | 2 +- pimd/pim_igmpv3.c | 52 ++++++++++++++++++++++---------------------- pimd/pim_join.c | 4 ++-- pimd/pim_nb_config.c | 26 +++++++++++----------- pimd/pim_neighbor.c | 32 +++++++++++++-------------- pimd/pim_oil.c | 4 ++-- pimd/pim_pim.c | 16 +++++++------- pimd/pim_ssmpingd.c | 6 ++--- pimd/pim_time.c | 6 ++--- pimd/pim_tlv.c | 2 +- pimd/pim_zebra.c | 4 ++-- pimd/pimd.c | 2 +- 17 files changed, 132 insertions(+), 132 deletions(-) diff --git a/pimd/pim_assert.c b/pimd/pim_assert.c index 957f904714..0988938701 100644 --- a/pimd/pim_assert.c +++ b/pimd/pim_assert.c @@ -304,7 +304,7 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh, msg_metric.ip_address = src_addr; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); ++pim_ifp->pim_ifstat_assert_recv; return dispatch_assert(ifp, msg_source_addr.u.prefix4, sg.grp, diff --git a/pimd/pim_hello.c b/pimd/pim_hello.c index 6f5c4174e2..e48a4bdd4d 100644 --- a/pimd/pim_hello.c +++ b/pimd/pim_hello.c @@ -141,14 +141,14 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr, on_trace(__func__, ifp, src_addr); pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); ++pim_ifp->pim_ifstat_hello_recv; /* Parse PIM hello TLVs */ - zassert(tlv_buf_size >= 0); + assert(tlv_buf_size >= 0); tlv_curr = tlv_buf; tlv_pastend = tlv_buf + tlv_buf_size; @@ -539,11 +539,11 @@ void pim_hello_require(struct interface *ifp) { struct pim_interface *pim_ifp; - zassert(ifp); + assert(ifp); pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); if (pim_ifp->pim_ifstat_hello_sent) return; diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index 62d19f7619..834399053b 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -115,8 +115,8 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim, { struct pim_interface *pim_ifp; - zassert(ifp); - zassert(!ifp->info); + assert(ifp); + assert(!ifp->info); pim_ifp = XCALLOC(MTYPE_PIM_INTERFACE, sizeof(*pim_ifp)); @@ -145,8 +145,8 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim, The number of seconds represented by the [Query Response Interval] must be less than the [Query Interval]. */ - zassert(pim_ifp->igmp_query_max_response_time_dsec - < pim_ifp->igmp_default_query_interval); + assert(pim_ifp->igmp_query_max_response_time_dsec + < pim_ifp->igmp_default_query_interval); if (pim) PIM_IF_DO_PIM(pim_ifp->options); @@ -198,9 +198,9 @@ void pim_if_delete(struct interface *ifp) struct pim_interface *pim_ifp; struct pim_ifchannel *ch; - zassert(ifp); + assert(ifp); pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); if (pim_ifp->igmp_join_list) { pim_if_igmp_join_del_all(ifp); @@ -238,7 +238,7 @@ void pim_if_update_could_assert(struct interface *ifp) struct pim_ifchannel *ch; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) { pim_ifchannel_update_could_assert(ch); @@ -251,7 +251,7 @@ static void pim_if_update_my_assert_metric(struct interface *ifp) struct pim_ifchannel *ch; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) { pim_ifchannel_update_my_assert_metric(ch); @@ -263,7 +263,7 @@ static void pim_addr_change(struct interface *ifp) struct pim_interface *pim_ifp; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); pim_if_dr_election(ifp); /* router's own DR Priority (addr) changes -- Done TODO T30 */ @@ -507,10 +507,10 @@ void pim_if_addr_add(struct connected *ifc) struct in_addr ifaddr; bool vxlan_term; - zassert(ifc); + assert(ifc); ifp = ifc->ifp; - zassert(ifp); + assert(ifp); pim_ifp = ifp->info; if (!pim_ifp) return; @@ -708,9 +708,9 @@ void pim_if_addr_del(struct connected *ifc, int force_prim_as_any) { struct interface *ifp; - zassert(ifc); + assert(ifc); ifp = ifc->ifp; - zassert(ifp); + assert(ifp); if (PIM_DEBUG_ZEBRA) zlog_debug("%s: %s ifindex=%d disconnected IP address %pFX %s", @@ -945,7 +945,7 @@ int pim_if_add_vif(struct interface *ifp, bool ispimreg, bool is_vxlan_term) struct in_addr ifaddr; unsigned char flags = 0; - zassert(pim_ifp); + assert(pim_ifp); if (pim_ifp->mroute_vif_index > 0) { zlog_warn("%s: vif_index=%d > 0 on interface %s ifindex=%d", @@ -1063,8 +1063,8 @@ int pim_if_lan_delay_enabled(struct interface *ifp) struct pim_interface *pim_ifp; pim_ifp = ifp->info; - zassert(pim_ifp); - zassert(pim_ifp->pim_number_of_nonlandelay_neighbors >= 0); + assert(pim_ifp); + assert(pim_ifp->pim_number_of_nonlandelay_neighbors >= 0); return pim_ifp->pim_number_of_nonlandelay_neighbors == 0; } @@ -1128,7 +1128,7 @@ struct pim_neighbor *pim_if_find_neighbor(struct interface *ifp, struct pim_interface *pim_ifp; struct prefix p; - zassert(ifp); + assert(ifp); pim_ifp = ifp->info; if (!pim_ifp) { @@ -1171,7 +1171,7 @@ long pim_if_t_suppressed_msec(struct interface *ifp) uint32_t ramount = 0; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); /* join suppression disabled ? */ if (PIM_IF_TEST_PIM_CAN_DISABLE_JOIN_SUPPRESSION(pim_ifp->options)) @@ -1196,7 +1196,7 @@ static struct igmp_join *igmp_join_find(struct list *join_list, struct listnode *node; struct igmp_join *ij; - zassert(join_list); + assert(join_list); for (ALL_LIST_ELEMENTS_RO(join_list, node, ij)) { if ((group_addr.s_addr == ij->group_addr.s_addr) @@ -1245,7 +1245,7 @@ static struct igmp_join *igmp_join_new(struct interface *ifp, int join_fd; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); join_fd = igmp_join_sock(ifp->name, ifp->ifindex, group_addr, source_addr); @@ -1416,7 +1416,7 @@ void pim_if_assert_on_neighbor_down(struct interface *ifp, struct pim_ifchannel *ch; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) { /* Is (S,G,I) assert loser ? */ diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index cdaf7bcdd4..579824c88d 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -498,7 +498,7 @@ void pim_ifchannel_membership_clear(struct interface *ifp) struct pim_ifchannel *ch; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) ifmembership_set(ch, PIM_IFMEMBERSHIP_NOINFO); @@ -510,7 +510,7 @@ void pim_ifchannel_delete_on_noinfo(struct interface *ifp) struct pim_ifchannel *ch, *ch_tmp; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); RB_FOREACH_SAFE (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb, ch_tmp) delete_on_noinfo(ch); @@ -825,7 +825,7 @@ static int nonlocal_upstream(int is_join, struct interface *recv_ifp, int is_local; /* boolean */ recv_pim_ifp = recv_ifp->info; - zassert(recv_pim_ifp); + assert(recv_pim_ifp); is_local = (upstream.s_addr == recv_pim_ifp->primary_address.s_addr); @@ -913,7 +913,7 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr, } pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); switch (ch->ifjoin_state) { case PIM_IFJOIN_NOINFO: @@ -939,7 +939,7 @@ void pim_ifchannel_join_add(struct interface *ifp, struct in_addr neigh_addr, } break; case PIM_IFJOIN_JOIN: - zassert(!ch->t_ifjoin_prune_pending_timer); + assert(!ch->t_ifjoin_prune_pending_timer); /* In the JOIN state ch->t_ifjoin_expiry_timer may be NULL due to diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index 73e42e9d83..f2b909e268 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -159,7 +159,7 @@ static int pim_igmp_other_querier_expire(struct thread *t) igmp = THREAD_ARG(t); - zassert(!igmp->t_igmp_query_timer); + assert(!igmp->t_igmp_query_timer); if (PIM_DEBUG_IGMP_TRACE) { char ifaddr_str[INET_ADDRSTRLEN]; @@ -185,9 +185,9 @@ void pim_igmp_other_querier_timer_on(struct igmp_sock *igmp) long other_querier_present_interval_msec; struct pim_interface *pim_ifp; - zassert(igmp); - zassert(igmp->interface); - zassert(igmp->interface->info); + assert(igmp); + assert(igmp->interface); + assert(igmp->interface->info); pim_ifp = igmp->interface->info; @@ -218,7 +218,7 @@ void pim_igmp_other_querier_timer_on(struct igmp_sock *igmp) Since this socket is starting the other-querier-present timer, there should not be periodic query timer for this socket. */ - zassert(!igmp->t_igmp_query_timer); + assert(!igmp->t_igmp_query_timer); /* RFC 3376: 8.5. Other Querier Present Interval @@ -255,7 +255,7 @@ void pim_igmp_other_querier_timer_on(struct igmp_sock *igmp) void pim_igmp_other_querier_timer_off(struct igmp_sock *igmp) { - zassert(igmp); + assert(igmp); if (PIM_DEBUG_IGMP_TRACE) { if (igmp->t_other_querier_timer) { @@ -589,9 +589,9 @@ void pim_igmp_general_query_on(struct igmp_sock *igmp) Since this socket is starting as querier, there should not exist a timer for other-querier-present. */ - zassert(!igmp->t_other_querier_timer); + assert(!igmp->t_other_querier_timer); pim_ifp = igmp->interface->info; - zassert(pim_ifp); + assert(pim_ifp); /* RFC 3376: 8.6. Startup Query Interval @@ -638,7 +638,7 @@ void pim_igmp_general_query_on(struct igmp_sock *igmp) void pim_igmp_general_query_off(struct igmp_sock *igmp) { - zassert(igmp); + assert(igmp); if (PIM_DEBUG_IGMP_TRACE) { if (igmp->t_igmp_query_timer) { @@ -664,8 +664,8 @@ static int pim_igmp_general_query(struct thread *t) igmp = THREAD_ARG(t); - zassert(igmp->interface); - zassert(igmp->interface->info); + assert(igmp->interface); + assert(igmp->interface->info); pim_ifp = igmp->interface->info; @@ -835,19 +835,19 @@ void igmp_group_delete(struct igmp_group *group) void igmp_group_delete_empty_include(struct igmp_group *group) { - zassert(!group->group_filtermode_isexcl); - zassert(!listcount(group->group_source_list)); + assert(!group->group_filtermode_isexcl); + assert(!listcount(group->group_source_list)); igmp_group_delete(group); } void igmp_sock_free(struct igmp_sock *igmp) { - zassert(!igmp->t_igmp_read); - zassert(!igmp->t_igmp_query_timer); - zassert(!igmp->t_other_querier_timer); - zassert(igmp->igmp_group_list); - zassert(!listcount(igmp->igmp_group_list)); + assert(!igmp->t_igmp_read); + assert(!igmp->t_igmp_query_timer); + assert(!igmp->t_other_querier_timer); + assert(igmp->igmp_group_list); + assert(!listcount(igmp->igmp_group_list)); list_delete(&igmp->igmp_group_list); hash_free(igmp->igmp_group_hash); @@ -1076,7 +1076,7 @@ static int igmp_group_timer(struct thread *t) group_str, group->group_igmp_sock->interface->name); } - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); group->group_filtermode_isexcl = 0; @@ -1085,7 +1085,7 @@ static int igmp_group_timer(struct thread *t) igmp_source_delete_expired(group->group_source_list); - zassert(!group->group_filtermode_isexcl); + assert(!group->group_filtermode_isexcl); /* RFC 3376: 6.2.2. Definition of Group Timers @@ -1137,7 +1137,7 @@ void igmp_group_timer_on(struct igmp_group *group, long interval_msec, it represents the time for the *filter-mode* of the group to expire and switch to INCLUDE mode. */ - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); thread_add_timer_msec(router->master, igmp_group_timer, group, interval_msec, &group->t_group_timer); @@ -1228,8 +1228,8 @@ struct igmp_group *igmp_add_group_by_addr(struct igmp_sock *igmp, it represents the time for the *filter-mode* of the group to expire and switch to INCLUDE mode. */ - zassert(!group->group_filtermode_isexcl); /* INCLUDE mode */ - zassert(!group->t_group_timer); /* group timer == 0 */ + assert(!group->group_filtermode_isexcl); /* INCLUDE mode */ + assert(!group->t_group_timer); /* group timer == 0 */ /* Any source (*,G) is forwarded only if mode is EXCLUDE {empty} */ igmp_anysource_forward_stop(group); diff --git a/pimd/pim_igmpv2.c b/pimd/pim_igmpv2.c index 7f3c7a0f8c..6eadf87c83 100644 --- a/pimd/pim_igmpv2.c +++ b/pimd/pim_igmpv2.c @@ -54,7 +54,7 @@ void igmp_v2_send_query(struct igmp_group *group, int fd, const char *ifname, /* max_resp_code must be non-zero else this will look like an IGMP v1 * query */ max_resp_code = igmp_msg_encode16to8(query_max_response_time_dsec); - zassert(max_resp_code > 0); + assert(max_resp_code > 0); query_buf[0] = PIM_IGMP_MEMBERSHIP_QUERY; query_buf[1] = max_resp_code; diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index 425adfe166..3ae7744eb0 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -103,7 +103,7 @@ void igmp_group_reset_gmi(struct igmp_group *group) it represents the time for the *filter-mode* of the group to expire and switch to INCLUDE mode. */ - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); igmp_group_timer_on(group, group_membership_interval_msec, ifp->name); } @@ -314,7 +314,7 @@ static void group_exclude_fwd_anysrc_ifempty(struct igmp_group *group) { struct pim_interface *pim_ifp = group->group_igmp_sock->interface->info; - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); if (listcount(group->group_source_list) < 1) { igmp_anysource_forward_start(pim_ifp->pim, group); @@ -324,7 +324,7 @@ static void group_exclude_fwd_anysrc_ifempty(struct igmp_group *group) void igmp_source_free(struct igmp_source *source) { /* make sure there is no source timer running */ - zassert(!source->t_source_timer); + assert(!source->t_source_timer); XFREE(MTYPE_PIM_IGMP_GROUP_SOURCE, source); } @@ -557,7 +557,7 @@ static void isex_excl(struct igmp_group *group, int num_sources, int i; /* EXCLUDE mode */ - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); /* E.1: set deletion flag for known sources (X,Y) */ source_mark_delete_flag(group); @@ -577,10 +577,10 @@ static void isex_excl(struct igmp_group *group, int num_sources, /* E.4: if not found, create source with timer=GMI: * (A-X-Y) */ source = source_new(group, *src_addr); - zassert(!source->t_source_timer); /* timer == 0 */ + assert(!source->t_source_timer); /* timer == 0 */ igmp_source_reset_gmi(group->group_igmp_sock, group, source); - zassert(source->t_source_timer); /* (A-X-Y) timer > 0 */ + assert(source->t_source_timer); /* (A-X-Y) timer > 0 */ } } /* scan received sources */ @@ -610,7 +610,7 @@ static void isex_incl(struct igmp_group *group, int num_sources, int i; /* INCLUDE mode */ - zassert(!group->group_filtermode_isexcl); + assert(!group->group_filtermode_isexcl); /* I.1: set deletion flag for known sources (A) */ source_mark_delete_flag(group); @@ -631,7 +631,7 @@ static void isex_incl(struct igmp_group *group, int num_sources, /* I.4: if not found, create source with timer=0 (B-A) */ source = source_new(group, *src_addr); - zassert(!source->t_source_timer); /* (B-A) timer=0 */ + assert(!source->t_source_timer); /* (B-A) timer=0 */ } } /* scan received sources */ @@ -641,7 +641,7 @@ static void isex_incl(struct igmp_group *group, int num_sources, group->group_filtermode_isexcl = 1; /* boolean=true */ - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); group_exclude_fwd_anysrc_ifempty(group); } @@ -675,10 +675,10 @@ void igmpv3_report_isex(struct igmp_sock *igmp, struct in_addr from, } else { /* INCLUDE mode */ isex_incl(group, num_sources, sources); - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); } - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); igmp_group_reset_gmi(group); } @@ -807,7 +807,7 @@ static void toex_incl(struct igmp_group *group, int num_sources, int num_sources_tosend = 0; int i; - zassert(!group->group_filtermode_isexcl); + assert(!group->group_filtermode_isexcl); /* Set DELETE flag for all known sources (A) */ source_mark_delete_flag(group); @@ -834,7 +834,7 @@ static void toex_incl(struct igmp_group *group, int num_sources, /* If source not found, create source with timer=0: * (B-A)=0 */ source = source_new(group, *src_addr); - zassert(!source->t_source_timer); /* (B-A) timer=0 */ + assert(!source->t_source_timer); /* (B-A) timer=0 */ } } /* Scan received sources (B) */ @@ -849,7 +849,7 @@ static void toex_incl(struct igmp_group *group, int num_sources, source_query_send_by_flag(group, num_sources_tosend); } - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); group_exclude_fwd_anysrc_ifempty(group); } @@ -894,17 +894,17 @@ static void toex_excl(struct igmp_group *group, int num_sources, long group_timer_msec; source = source_new(group, *src_addr); - zassert(!source->t_source_timer); /* timer == 0 */ + assert(!source->t_source_timer); /* timer == 0 */ group_timer_msec = igmp_group_timer_remain_msec(group); igmp_source_timer_on(group, source, group_timer_msec); - zassert(source->t_source_timer); /* (A-X-Y) timer > 0 */ + assert(source->t_source_timer); /* (A-X-Y) timer > 0 */ /* make sure source is created with DELETE flag unset */ - zassert(!IGMP_SOURCE_TEST_DELETE(source->source_flags)); + assert(!IGMP_SOURCE_TEST_DELETE(source->source_flags)); } /* make sure reported source has DELETE flag unset */ - zassert(!IGMP_SOURCE_TEST_DELETE(source->source_flags)); + assert(!IGMP_SOURCE_TEST_DELETE(source->source_flags)); if (source->t_source_timer) { /* if source timer>0 mark SEND flag: Q(G,A-Y) */ @@ -948,9 +948,9 @@ void igmpv3_report_toex(struct igmp_sock *igmp, struct in_addr from, } else { /* INCLUDE mode */ toex_incl(group, num_sources, sources); - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); } - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); /* Group Timer=GMI */ igmp_group_reset_gmi(group); @@ -1347,7 +1347,7 @@ static void source_query_send_by_flag(struct igmp_group *group, long lmqi_msec; /* Last Member Query Interval */ long lmqt_msec; /* Last Member Query Time */ - zassert(num_sources_tosend > 0); + assert(num_sources_tosend > 0); igmp = group->group_igmp_sock; pim_ifp = igmp->interface->info; @@ -1408,10 +1408,10 @@ static void block_excl(struct igmp_group *group, int num_sources, long group_timer_msec; source = source_new(group, *src_addr); - zassert(!source->t_source_timer); /* timer == 0 */ + assert(!source->t_source_timer); /* timer == 0 */ group_timer_msec = igmp_group_timer_remain_msec(group); igmp_source_timer_on(group, source, group_timer_msec); - zassert(source->t_source_timer); /* (A-X-Y) timer > 0 */ + assert(source->t_source_timer); /* (A-X-Y) timer > 0 */ } if (source->t_source_timer) { @@ -1523,7 +1523,7 @@ void igmp_group_timer_lower_to_lmqt(struct igmp_group *group) lmqt_msec); } - zassert(group->group_filtermode_isexcl); + assert(group->group_filtermode_isexcl); igmp_group_timer_on(group, lmqt_msec, ifname); } @@ -1581,7 +1581,7 @@ void igmp_v3_send_query(struct igmp_group *group, int fd, const char *ifname, socklen_t tolen; uint16_t checksum; - zassert(num_sources >= 0); + assert(num_sources >= 0); msg_size = IGMP_V3_SOURCES_OFFSET + (num_sources << 2); if (msg_size > query_buf_size) { @@ -1593,7 +1593,7 @@ void igmp_v3_send_query(struct igmp_group *group, int fd, const char *ifname, } s_flag = PIM_FORCE_BOOLEAN(s_flag); - zassert((s_flag == 0) || (s_flag == 1)); + assert((s_flag == 0) || (s_flag == 1)); max_resp_code = igmp_msg_encode16to8(query_max_response_time_dsec); qqic = igmp_msg_encode16to8(querier_query_interval); diff --git a/pimd/pim_join.c b/pimd/pim_join.c index 2766a6d2b5..c7a80ca8e0 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -71,7 +71,7 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh, } pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); ++pim_ifp->pim_ifstat_join_recv; @@ -134,7 +134,7 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh, } pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); ++pim_ifp->pim_ifstat_prune_recv; diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index cf712bfbca..4552c6cd42 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -38,7 +38,7 @@ static void pim_if_membership_clear(struct interface *ifp) struct pim_interface *pim_ifp; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); if (PIM_IF_TEST_PIM(pim_ifp->options) && PIM_IF_TEST_IGMP(pim_ifp->options)) { @@ -64,7 +64,7 @@ static void pim_if_membership_refresh(struct interface *ifp) struct igmp_sock *igmp; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); if (!PIM_IF_TEST_PIM(pim_ifp->options)) return; @@ -578,7 +578,7 @@ static void igmp_sock_query_interval_reconfig(struct igmp_sock *igmp) struct interface *ifp; struct pim_interface *pim_ifp; - zassert(igmp); + assert(igmp); /* other querier present? */ @@ -587,8 +587,8 @@ static void igmp_sock_query_interval_reconfig(struct igmp_sock *igmp) /* this is the querier */ - zassert(igmp->interface); - zassert(igmp->interface->info); + assert(igmp->interface); + assert(igmp->interface->info); ifp = igmp->interface; pim_ifp = ifp->info; @@ -618,25 +618,25 @@ static void igmp_sock_query_reschedule(struct igmp_sock *igmp) if (igmp->t_igmp_query_timer) { /* other querier present */ - zassert(igmp->t_igmp_query_timer); - zassert(!igmp->t_other_querier_timer); + assert(igmp->t_igmp_query_timer); + assert(!igmp->t_other_querier_timer); pim_igmp_general_query_off(igmp); pim_igmp_general_query_on(igmp); - zassert(igmp->t_igmp_query_timer); - zassert(!igmp->t_other_querier_timer); + assert(igmp->t_igmp_query_timer); + assert(!igmp->t_other_querier_timer); } else { /* this is the querier */ - zassert(!igmp->t_igmp_query_timer); - zassert(igmp->t_other_querier_timer); + assert(!igmp->t_igmp_query_timer); + assert(igmp->t_other_querier_timer); pim_igmp_other_querier_timer_off(igmp); pim_igmp_other_querier_timer_on(igmp); - zassert(!igmp->t_igmp_query_timer); - zassert(igmp->t_other_querier_timer); + assert(!igmp->t_igmp_query_timer); + assert(igmp->t_other_querier_timer); } } diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index 167aa3c604..1c97a2c9c9 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -49,7 +49,7 @@ static void dr_election_by_addr(struct interface *ifp) struct pim_neighbor *neigh; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); pim_ifp->pim_dr_addr = pim_ifp->primary_address; @@ -73,7 +73,7 @@ static void dr_election_by_pri(struct interface *ifp) uint32_t dr_pri; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); pim_ifp->pim_dr_addr = pim_ifp->primary_address; dr_pri = pim_ifp->pim_dr_priority; @@ -310,9 +310,9 @@ pim_neighbor_new(struct interface *ifp, struct in_addr source_addr, struct pim_neighbor *neigh; char src_str[INET_ADDRSTRLEN]; - zassert(ifp); + assert(ifp); pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); neigh = XCALLOC(MTYPE_PIM_NEIGHBOR, sizeof(*neigh)); @@ -412,7 +412,7 @@ static void delete_prefix_list(struct pim_neighbor *neigh) void pim_neighbor_free(struct pim_neighbor *neigh) { - zassert(!neigh->t_expire_timer); + assert(!neigh->t_expire_timer); delete_prefix_list(neigh); @@ -504,7 +504,7 @@ pim_neighbor_add(struct interface *ifp, struct in_addr source_addr, } pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); listnode_add(pim_ifp->pim_neighbor_list, neigh); @@ -567,7 +567,7 @@ static uint16_t find_neighbors_next_highest_propagation_delay_msec( uint16_t next_highest_delay_msec; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); next_highest_delay_msec = pim_ifp->pim_propagation_delay_msec; @@ -591,7 +591,7 @@ static uint16_t find_neighbors_next_highest_override_interval_msec( uint16_t next_highest_interval_msec; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); next_highest_interval_msec = pim_ifp->pim_override_interval_msec; @@ -614,7 +614,7 @@ void pim_neighbor_delete(struct interface *ifp, struct pim_neighbor *neigh, char src_str[INET_ADDRSTRLEN]; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); pim_inet4_dump("", neigh->source_addr, src_str, sizeof(src_str)); zlog_info("PIM NEIGHBOR DOWN: neighbor %s on interface %s: %s", src_str, @@ -638,10 +638,10 @@ void pim_neighbor_delete(struct interface *ifp, struct pim_neighbor *neigh, --pim_ifp->pim_dr_num_nondrpri_neighbors; } - zassert(neigh->propagation_delay_msec - <= pim_ifp->pim_neighbors_highest_propagation_delay_msec); - zassert(neigh->override_interval_msec - <= pim_ifp->pim_neighbors_highest_override_interval_msec); + assert(neigh->propagation_delay_msec + <= pim_ifp->pim_neighbors_highest_propagation_delay_msec); + assert(neigh->override_interval_msec + <= pim_ifp->pim_neighbors_highest_override_interval_msec); if (pim_if_lan_delay_enabled(ifp)) { @@ -687,7 +687,7 @@ void pim_neighbor_delete_all(struct interface *ifp, const char *delete_message) struct pim_neighbor *neigh; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); for (ALL_LIST_ELEMENTS(pim_ifp->pim_neighbor_list, neigh_node, neigh_nextnode, neigh)) { @@ -732,9 +732,9 @@ static void delete_from_neigh_addr(struct interface *ifp, struct pim_interface *pim_ifp; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); - zassert(addr_list); + assert(addr_list); /* Scan secondary address list diff --git a/pimd/pim_oil.c b/pimd/pim_oil.c index 3ec0720fc4..0a4e3e1a6f 100644 --- a/pimd/pim_oil.c +++ b/pimd/pim_oil.c @@ -219,8 +219,8 @@ int pim_channel_del_oif(struct channel_oil *channel_oil, struct interface *oif, { struct pim_interface *pim_ifp; - zassert(channel_oil); - zassert(oif); + assert(channel_oil); + assert(oif); pim_ifp = oif->info; diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index 2ccff8b84a..4ba08a19d8 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -407,8 +407,8 @@ static void pim_sock_read_on(struct interface *ifp) { struct pim_interface *pim_ifp; - zassert(ifp); - zassert(ifp->info); + assert(ifp); + assert(ifp->info); pim_ifp = ifp->info; @@ -444,7 +444,7 @@ void pim_ifstat_reset(struct interface *ifp) { struct pim_interface *pim_ifp; - zassert(ifp); + assert(ifp); pim_ifp = ifp->info; if (!pim_ifp) { @@ -462,8 +462,8 @@ void pim_sock_reset(struct interface *ifp) { struct pim_interface *pim_ifp; - zassert(ifp); - zassert(ifp->info); + assert(ifp); + assert(ifp->info); pim_ifp = ifp->info; @@ -671,8 +671,8 @@ static int hello_send(struct interface *ifp, uint16_t holdtime) pim_msg_size = pim_tlv_size + PIM_PIM_MIN_LEN; - zassert(pim_msg_size >= PIM_PIM_MIN_LEN); - zassert(pim_msg_size <= PIM_PIM_BUFSIZE_WRITE); + assert(pim_msg_size >= PIM_PIM_MIN_LEN); + assert(pim_msg_size <= PIM_PIM_BUFSIZE_WRITE); pim_msg_build_header(pim_msg, pim_msg_size, PIM_MSG_TYPE_HELLO, false); @@ -846,7 +846,7 @@ int pim_sock_add(struct interface *ifp) uint32_t old_genid; pim_ifp = ifp->info; - zassert(pim_ifp); + assert(pim_ifp); if (pim_ifp->pim_sock_fd >= 0) { if (PIM_DEBUG_PIM_PACKETS) diff --git a/pimd/pim_ssmpingd.c b/pimd/pim_ssmpingd.c index f4d3547b3f..03e77de161 100644 --- a/pimd/pim_ssmpingd.c +++ b/pimd/pim_ssmpingd.c @@ -41,12 +41,12 @@ void pim_ssmpingd_init(struct pim_instance *pim) { int result; - zassert(!pim->ssmpingd_list); + assert(!pim->ssmpingd_list); result = inet_pton(AF_INET, PIM_SSMPINGD_REPLY_GROUP, &pim->ssmpingd_group_addr); - zassert(result > 0); + assert(result > 0); } void pim_ssmpingd_destroy(struct pim_instance *pim) @@ -197,7 +197,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl) static void ssmpingd_delete(struct ssmpingd_sock *ss) { - zassert(ss); + assert(ss); THREAD_OFF(ss->t_sock_read); diff --git a/pimd/pim_time.c b/pimd/pim_time.c index 9878fcf6b4..c88ee7554b 100644 --- a/pimd/pim_time.c +++ b/pimd/pim_time.c @@ -106,7 +106,7 @@ int pim_time_mmss(char *buf, int buf_size, long sec) long mm; int wr; - zassert(buf_size >= 5); + assert(buf_size >= 5); mm = sec / 60; sec %= 60; @@ -122,7 +122,7 @@ static int pim_time_hhmmss(char *buf, int buf_size, long sec) long mm; int wr; - zassert(buf_size >= 8); + assert(buf_size >= 8); hh = sec / 3600; sec %= 3600; @@ -156,7 +156,7 @@ void pim_time_timer_to_hhmmss(char *buf, int buf_size, struct thread *t_timer) void pim_time_uptime(char *buf, int buf_size, int64_t uptime_sec) { - zassert(buf_size >= 8); + assert(buf_size >= 8); pim_time_hhmmss(buf, buf_size, uptime_sec); } diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c index 633bb207bd..f21c369b8d 100644 --- a/pimd/pim_tlv.c +++ b/pimd/pim_tlv.c @@ -662,7 +662,7 @@ int pim_tlv_parse_addr_list(const char *ifname, struct in_addr src_addr, const uint8_t *addr; const uint8_t *pastend; - zassert(hello_option_addr_list); + assert(hello_option_addr_list); /* Scan addr list diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index f0eae955cc..6f933e9e72 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -471,8 +471,8 @@ void igmp_anysource_forward_start(struct pim_instance *pim, struct igmp_source *source; struct in_addr src_addr = {.s_addr = 0}; /* Any source (*,G) is forwarded only if mode is EXCLUDE {empty} */ - zassert(group->group_filtermode_isexcl); - zassert(listcount(group->group_source_list) < 1); + assert(group->group_filtermode_isexcl); + assert(listcount(group->group_source_list) < 1); source = source_new(group, src_addr); if (!source) { diff --git a/pimd/pimd.c b/pimd/pimd.c index 811dc96b56..1679480794 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -126,7 +126,7 @@ void pim_init(void) "%s %s: could not solve %s to group address: errno=%d: %s", __FILE__, __func__, PIM_ALL_PIM_ROUTERS, errno, safe_strerror(errno)); - zassert(0); + assert(0); return; } -- 2.39.5