mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 17:48:35 +00:00
pimd: Remove unnecessary asserts
When we handle the thread arguments, there is no need to assert. As that if they are wrong, we are going down shortly anyways. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
220d8a49e6
commit
7f8b8a9af6
@ -516,12 +516,9 @@ static int on_assert_timer(struct thread *t)
|
|||||||
struct pim_ifchannel *ch;
|
struct pim_ifchannel *ch;
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
ch = THREAD_ARG(t);
|
ch = THREAD_ARG(t);
|
||||||
zassert(ch);
|
|
||||||
|
|
||||||
ifp = ch->interface;
|
ifp = ch->interface;
|
||||||
zassert(ifp);
|
|
||||||
|
|
||||||
if (PIM_DEBUG_PIM_TRACE) {
|
if (PIM_DEBUG_PIM_TRACE) {
|
||||||
zlog_debug("%s: (S,G)=%s timer expired on interface %s",
|
zlog_debug("%s: (S,G)=%s timer expired on interface %s",
|
||||||
|
@ -489,9 +489,7 @@ static int on_ifjoin_expiry_timer(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct pim_ifchannel *ch;
|
struct pim_ifchannel *ch;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
ch = THREAD_ARG(t);
|
ch = THREAD_ARG(t);
|
||||||
zassert(ch);
|
|
||||||
|
|
||||||
ch->t_ifjoin_expiry_timer = NULL;
|
ch->t_ifjoin_expiry_timer = NULL;
|
||||||
|
|
||||||
@ -510,9 +508,7 @@ static int on_ifjoin_prune_pending_timer(struct thread *t)
|
|||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
struct pim_interface *pim_ifp;
|
struct pim_interface *pim_ifp;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
ch = THREAD_ARG(t);
|
ch = THREAD_ARG(t);
|
||||||
zassert(ch);
|
|
||||||
|
|
||||||
ch->t_ifjoin_prune_pending_timer = NULL;
|
ch->t_ifjoin_prune_pending_timer = NULL;
|
||||||
|
|
||||||
|
@ -153,9 +153,7 @@ static int pim_igmp_other_querier_expire(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct igmp_sock *igmp;
|
struct igmp_sock *igmp;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
igmp = THREAD_ARG(t);
|
igmp = THREAD_ARG(t);
|
||||||
zassert(igmp);
|
|
||||||
|
|
||||||
zassert(igmp->t_other_querier_timer);
|
zassert(igmp->t_other_querier_timer);
|
||||||
zassert(!igmp->t_igmp_query_timer);
|
zassert(!igmp->t_igmp_query_timer);
|
||||||
@ -598,11 +596,8 @@ static int pim_igmp_general_query(struct thread *t)
|
|||||||
struct pim_interface *pim_ifp;
|
struct pim_interface *pim_ifp;
|
||||||
int query_buf_size;
|
int query_buf_size;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
|
|
||||||
igmp = THREAD_ARG(t);
|
igmp = THREAD_ARG(t);
|
||||||
|
|
||||||
zassert(igmp);
|
|
||||||
zassert(igmp->interface);
|
zassert(igmp->interface);
|
||||||
zassert(igmp->interface->info);
|
zassert(igmp->interface->info);
|
||||||
|
|
||||||
@ -898,9 +893,7 @@ static int igmp_group_timer(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct igmp_group *group;
|
struct igmp_group *group;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
group = THREAD_ARG(t);
|
group = THREAD_ARG(t);
|
||||||
zassert(group);
|
|
||||||
|
|
||||||
if (PIM_DEBUG_IGMP_TRACE) {
|
if (PIM_DEBUG_IGMP_TRACE) {
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
|
@ -115,9 +115,7 @@ static int igmp_source_timer(struct thread *t)
|
|||||||
struct igmp_source *source;
|
struct igmp_source *source;
|
||||||
struct igmp_group *group;
|
struct igmp_group *group;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
source = THREAD_ARG(t);
|
source = THREAD_ARG(t);
|
||||||
zassert(source);
|
|
||||||
|
|
||||||
group = source->source_group;
|
group = source->source_group;
|
||||||
|
|
||||||
@ -1245,9 +1243,7 @@ static int igmp_group_retransmit(struct thread *t)
|
|||||||
int num_retransmit_sources_left;
|
int num_retransmit_sources_left;
|
||||||
int send_with_sflag_set; /* boolean */
|
int send_with_sflag_set; /* boolean */
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
group = THREAD_ARG(t);
|
group = THREAD_ARG(t);
|
||||||
zassert(group);
|
|
||||||
|
|
||||||
if (PIM_DEBUG_IGMP_TRACE) {
|
if (PIM_DEBUG_IGMP_TRACE) {
|
||||||
char group_str[INET_ADDRSTRLEN];
|
char group_str[INET_ADDRSTRLEN];
|
||||||
|
@ -528,11 +528,8 @@ static int mroute_read(struct thread *t)
|
|||||||
int fd;
|
int fd;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
zassert(!THREAD_ARG(t));
|
|
||||||
|
|
||||||
fd = THREAD_FD(t);
|
fd = THREAD_FD(t);
|
||||||
zassert(fd == qpim_mroute_socket_fd);
|
|
||||||
|
|
||||||
result = mroute_read_msg(fd);
|
result = mroute_read_msg(fd);
|
||||||
|
|
||||||
|
@ -106,9 +106,7 @@ pim_msdp_sa_state_timer_cb(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct pim_msdp_sa *sa;
|
struct pim_msdp_sa *sa;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
sa = THREAD_ARG(t);
|
sa = THREAD_ARG(t);
|
||||||
zassert(sa);
|
|
||||||
|
|
||||||
if (PIM_DEBUG_MSDP_EVENTS) {
|
if (PIM_DEBUG_MSDP_EVENTS) {
|
||||||
pim_msdp_sa_timer_expiry_log(sa, "state");
|
pim_msdp_sa_timer_expiry_log(sa, "state");
|
||||||
@ -595,9 +593,7 @@ pim_msdp_peer_hold_timer_cb(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct pim_msdp_peer *mp;
|
struct pim_msdp_peer *mp;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
mp = THREAD_ARG(t);
|
mp = THREAD_ARG(t);
|
||||||
zassert(mp);
|
|
||||||
|
|
||||||
if (PIM_DEBUG_MSDP_EVENTS) {
|
if (PIM_DEBUG_MSDP_EVENTS) {
|
||||||
pim_msdp_peer_timer_expiry_log(mp, "hold");
|
pim_msdp_peer_timer_expiry_log(mp, "hold");
|
||||||
@ -630,9 +626,7 @@ pim_msdp_peer_ka_timer_cb(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct pim_msdp_peer *mp;
|
struct pim_msdp_peer *mp;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
mp = THREAD_ARG(t);
|
mp = THREAD_ARG(t);
|
||||||
zassert(mp);
|
|
||||||
|
|
||||||
if (PIM_DEBUG_MSDP_EVENTS) {
|
if (PIM_DEBUG_MSDP_EVENTS) {
|
||||||
pim_msdp_peer_timer_expiry_log(mp, "ka");
|
pim_msdp_peer_timer_expiry_log(mp, "ka");
|
||||||
@ -695,9 +689,7 @@ pim_msdp_peer_cr_timer_cb(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct pim_msdp_peer *mp;
|
struct pim_msdp_peer *mp;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
mp = THREAD_ARG(t);
|
mp = THREAD_ARG(t);
|
||||||
zassert(mp);
|
|
||||||
|
|
||||||
if (PIM_DEBUG_MSDP_EVENTS) {
|
if (PIM_DEBUG_MSDP_EVENTS) {
|
||||||
pim_msdp_peer_timer_expiry_log(mp, "connect-retry");
|
pim_msdp_peer_timer_expiry_log(mp, "connect-retry");
|
||||||
|
@ -211,9 +211,7 @@ static int on_neighbor_timer(struct thread *t)
|
|||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
char msg[100];
|
char msg[100];
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
neigh = THREAD_ARG(t);
|
neigh = THREAD_ARG(t);
|
||||||
zassert(neigh);
|
|
||||||
|
|
||||||
ifp = neigh->interface;
|
ifp = neigh->interface;
|
||||||
|
|
||||||
|
@ -295,11 +295,7 @@ static int pim_sock_read(struct thread *t)
|
|||||||
ifindex_t ifindex = -1;
|
ifindex_t ifindex = -1;
|
||||||
int result = -1; /* defaults to bad */
|
int result = -1; /* defaults to bad */
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
|
|
||||||
ifp = THREAD_ARG(t);
|
ifp = THREAD_ARG(t);
|
||||||
zassert(ifp);
|
|
||||||
|
|
||||||
fd = THREAD_FD(t);
|
fd = THREAD_FD(t);
|
||||||
|
|
||||||
pim_ifp = ifp->info;
|
pim_ifp = ifp->info;
|
||||||
@ -695,9 +691,7 @@ static int on_pim_hello_send(struct thread *t)
|
|||||||
struct pim_interface *pim_ifp;
|
struct pim_interface *pim_ifp;
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
ifp = THREAD_ARG(t);
|
ifp = THREAD_ARG(t);
|
||||||
zassert(ifp);
|
|
||||||
|
|
||||||
pim_ifp = ifp->info;
|
pim_ifp = ifp->info;
|
||||||
|
|
||||||
|
@ -315,10 +315,7 @@ static int ssmpingd_sock_read(struct thread *t)
|
|||||||
int sock_fd;
|
int sock_fd;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
|
|
||||||
ss = THREAD_ARG(t);
|
ss = THREAD_ARG(t);
|
||||||
zassert(ss);
|
|
||||||
|
|
||||||
sock_fd = THREAD_FD(t);
|
sock_fd = THREAD_FD(t);
|
||||||
zassert(sock_fd == ss->sock_fd);
|
zassert(sock_fd == ss->sock_fd);
|
||||||
|
@ -243,9 +243,7 @@ static int on_join_timer(struct thread *t)
|
|||||||
{
|
{
|
||||||
struct pim_upstream *up;
|
struct pim_upstream *up;
|
||||||
|
|
||||||
zassert(t);
|
|
||||||
up = THREAD_ARG(t);
|
up = THREAD_ARG(t);
|
||||||
zassert(up);
|
|
||||||
|
|
||||||
up->t_join_timer = NULL;
|
up->t_join_timer = NULL;
|
||||||
|
|
||||||
|
@ -531,7 +531,6 @@ void pim_scan_oil()
|
|||||||
|
|
||||||
static int on_rpf_cache_refresh(struct thread *t)
|
static int on_rpf_cache_refresh(struct thread *t)
|
||||||
{
|
{
|
||||||
zassert(t);
|
|
||||||
zassert(qpim_rpf_cache_refresher);
|
zassert(qpim_rpf_cache_refresher);
|
||||||
|
|
||||||
qpim_rpf_cache_refresher = 0;
|
qpim_rpf_cache_refresher = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user