diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-02-23 01:04:25 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-02-24 01:56:04 +0100 |
commit | cc9f21da2218d95567eff1501482ce58e6600f54 (patch) | |
tree | d579c9754161d874bad6eb09c67821b65fb559ca /eigrpd | |
parent | Merge pull request #10621 from donaldsharp/cov_fun (diff) | |
download | frr-cc9f21da2218d95567eff1501482ce58e6600f54.tar.xz frr-cc9f21da2218d95567eff1501482ce58e6600f54.zip |
*: Change thread->func to return void instead of int
The int return value is never used. Modify the code
base to just return a void instead.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'eigrpd')
-rw-r--r-- | eigrpd/eigrp_filter.c | 12 | ||||
-rw-r--r-- | eigrpd/eigrp_filter.h | 4 | ||||
-rw-r--r-- | eigrpd/eigrp_hello.c | 6 | ||||
-rw-r--r-- | eigrpd/eigrp_neighbor.c | 4 | ||||
-rw-r--r-- | eigrpd/eigrp_neighbor.h | 2 | ||||
-rw-r--r-- | eigrpd/eigrp_network.h | 2 | ||||
-rw-r--r-- | eigrpd/eigrp_packet.c | 44 | ||||
-rw-r--r-- | eigrpd/eigrp_packet.h | 12 | ||||
-rw-r--r-- | eigrpd/eigrp_update.c | 6 |
9 files changed, 39 insertions, 53 deletions
diff --git a/eigrpd/eigrp_filter.c b/eigrpd/eigrp_filter.c index 69c0d22ae..8d50ed689 100644 --- a/eigrpd/eigrp_filter.c +++ b/eigrpd/eigrp_filter.c @@ -251,13 +251,13 @@ void eigrp_distribute_update_all_wrapper(struct access_list *notused) * * @param[in] thread current execution thread timer is associated with * - * @return int always returns 0 + * @return void * * @par * Called when 10sec waiting time expire and * executes Graceful restart for whole process */ -int eigrp_distribute_timer_process(struct thread *thread) +void eigrp_distribute_timer_process(struct thread *thread) { struct eigrp *eigrp; @@ -265,8 +265,6 @@ int eigrp_distribute_timer_process(struct thread *thread) /* execute GR for whole process */ eigrp_update_send_process_GR(eigrp, EIGRP_GR_FILTER, NULL); - - return 0; } /* @@ -274,13 +272,13 @@ int eigrp_distribute_timer_process(struct thread *thread) * * @param[in] thread current execution thread timer is associated with * - * @return int always returns 0 + * @return void * * @par * Called when 10sec waiting time expire and * executes Graceful restart for interface */ -int eigrp_distribute_timer_interface(struct thread *thread) +void eigrp_distribute_timer_interface(struct thread *thread) { struct eigrp_interface *ei; @@ -289,6 +287,4 @@ int eigrp_distribute_timer_interface(struct thread *thread) /* execute GR for interface */ eigrp_update_send_interface_GR(ei, EIGRP_GR_FILTER, NULL); - - return 0; } diff --git a/eigrpd/eigrp_filter.h b/eigrpd/eigrp_filter.h index 03f45cedb..4dbfe276d 100644 --- a/eigrpd/eigrp_filter.h +++ b/eigrpd/eigrp_filter.h @@ -38,7 +38,7 @@ extern void eigrp_distribute_update(struct distribute_ctx *ctx, extern void eigrp_distribute_update_interface(struct interface *ifp); extern void eigrp_distribute_update_all(struct prefix_list *plist); extern void eigrp_distribute_update_all_wrapper(struct access_list *alist); -extern int eigrp_distribute_timer_process(struct thread *thread); -extern int eigrp_distribute_timer_interface(struct thread *thread); +extern void eigrp_distribute_timer_process(struct thread *thread); +extern void eigrp_distribute_timer_interface(struct thread *thread); #endif /* EIGRPD_EIGRP_FILTER_H_ */ diff --git a/eigrpd/eigrp_hello.c b/eigrpd/eigrp_hello.c index 2ff8fc5f3..717d8c095 100644 --- a/eigrpd/eigrp_hello.c +++ b/eigrpd/eigrp_hello.c @@ -74,14 +74,14 @@ static const struct message eigrp_general_tlv_type_str[] = { * * @param[in] thread current execution thread timer is associated with * - * @return int always returns 0 + * @return void * * @par * Called once per "hello" time interval, default 5 seconds * Sends hello packet via multicast for all interfaces eigrp * is configured for */ -int eigrp_hello_timer(struct thread *thread) +void eigrp_hello_timer(struct thread *thread) { struct eigrp_interface *ei; @@ -97,8 +97,6 @@ int eigrp_hello_timer(struct thread *thread) /* Hello timer set. */ thread_add_timer(master, eigrp_hello_timer, ei, ei->params.v_hello, &ei->t_hello); - - return 0; } /** diff --git a/eigrpd/eigrp_neighbor.c b/eigrpd/eigrp_neighbor.c index f2d5217eb..0ed8927d4 100644 --- a/eigrpd/eigrp_neighbor.c +++ b/eigrpd/eigrp_neighbor.c @@ -189,7 +189,7 @@ void eigrp_nbr_delete(struct eigrp_neighbor *nbr) XFREE(MTYPE_EIGRP_NEIGHBOR, nbr); } -int holddown_timer_expired(struct thread *thread) +void holddown_timer_expired(struct thread *thread) { struct eigrp_neighbor *nbr = THREAD_ARG(thread); struct eigrp *eigrp = nbr->ei->eigrp; @@ -198,8 +198,6 @@ int holddown_timer_expired(struct thread *thread) ifindex2ifname(nbr->ei->ifp->ifindex, eigrp->vrf_id)); nbr->state = EIGRP_NEIGHBOR_DOWN; eigrp_nbr_delete(nbr); - - return 0; } uint8_t eigrp_nbr_state_get(struct eigrp_neighbor *nbr) diff --git a/eigrpd/eigrp_neighbor.h b/eigrpd/eigrp_neighbor.h index 80ab1eded..693d780f0 100644 --- a/eigrpd/eigrp_neighbor.h +++ b/eigrpd/eigrp_neighbor.h @@ -39,7 +39,7 @@ extern struct eigrp_neighbor *eigrp_nbr_get(struct eigrp_interface *ei, extern struct eigrp_neighbor *eigrp_nbr_new(struct eigrp_interface *ei); extern void eigrp_nbr_delete(struct eigrp_neighbor *neigh); -extern int holddown_timer_expired(struct thread *thread); +extern void holddown_timer_expired(struct thread *thread); extern int eigrp_neighborship_check(struct eigrp_neighbor *neigh, struct TLV_Parameter_Type *tlv); diff --git a/eigrpd/eigrp_network.h b/eigrpd/eigrp_network.h index eeb32ba35..912a9248c 100644 --- a/eigrpd/eigrp_network.h +++ b/eigrpd/eigrp_network.h @@ -35,7 +35,7 @@ extern int eigrp_if_ipmulticast(struct eigrp *, struct prefix *, unsigned int); extern int eigrp_network_set(struct eigrp *eigrp, struct prefix *p); extern int eigrp_network_unset(struct eigrp *eigrp, struct prefix *p); -extern int eigrp_hello_timer(struct thread *); +extern void eigrp_hello_timer(struct thread *thread); extern void eigrp_if_update(struct interface *); extern int eigrp_if_add_allspfrouters(struct eigrp *, struct prefix *, unsigned int); diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c index 529d94567..491b2994b 100644 --- a/eigrpd/eigrp_packet.c +++ b/eigrpd/eigrp_packet.c @@ -320,7 +320,7 @@ int eigrp_check_sha256_digest(struct stream *s, return 1; } -int eigrp_write(struct thread *thread) +void eigrp_write(struct thread *thread) { struct eigrp *eigrp = THREAD_ARG(thread); struct eigrp_header *eigrph; @@ -471,12 +471,10 @@ out: thread_add_write(master, eigrp_write, eigrp, eigrp->fd, &eigrp->t_write); } - - return 0; } /* Starting point of packet process function. */ -int eigrp_read(struct thread *thread) +void eigrp_read(struct thread *thread) { int ret; struct stream *ibuf; @@ -500,7 +498,7 @@ int eigrp_read(struct thread *thread) if (!(ibuf = eigrp_recv_packet(eigrp, eigrp->fd, &ifp, eigrp->ibuf))) { /* This raw packet is known to be at least as big as its IP * header. */ - return -1; + return; } /* Note that there should not be alignment problems with this assignment @@ -531,7 +529,7 @@ int eigrp_read(struct thread *thread) eigrp->vrf_id); if (c == NULL) - return 0; + return; ifp = c->ifp; } @@ -546,7 +544,7 @@ int eigrp_read(struct thread *thread) must remain very accurate in doing this. */ if (!ei) - return 0; + return; /* Self-originated packet should be discarded silently. */ if (eigrp_if_lookup_by_local_addr(eigrp, NULL, iph->ip_src) @@ -555,7 +553,7 @@ int eigrp_read(struct thread *thread) zlog_debug( "eigrp_read[%pI4]: Dropping self-originated packet", &srcaddr); - return 0; + return; } /* Advance from IP header to EIGRP header (iph->ip_hl has been verified @@ -574,7 +572,7 @@ int eigrp_read(struct thread *thread) "ignoring packet from router %u sent to %pI4, wrong AS Number received: %u", ntohs(eigrph->vrid), &iph->ip_dst, ntohs(eigrph->ASNumber)); - return 0; + return; } /* If incoming interface is passive one, ignore it. */ @@ -588,7 +586,7 @@ int eigrp_read(struct thread *thread) if (iph->ip_dst.s_addr == htonl(EIGRP_MULTICAST_ADDRESS)) { eigrp_if_set_multicast(ei); } - return 0; + return; } /* else it must be a local eigrp interface, check it was received on @@ -599,7 +597,7 @@ int eigrp_read(struct thread *thread) zlog_warn( "Packet from [%pI4] received on wrong link %s", &iph->ip_src, ifp->name); - return 0; + return; } /* Verify more EIGRP header fields. */ @@ -609,7 +607,7 @@ int eigrp_read(struct thread *thread) zlog_debug( "eigrp_read[%pI4]: Header check failed, dropping.", &iph->ip_src); - return ret; + return; } /* calcualte the eigrp packet length, and move the pounter to the @@ -700,8 +698,6 @@ int eigrp_read(struct thread *thread) IF_NAME(ei), opcode); break; } - - return 0; } static struct stream *eigrp_recv_packet(struct eigrp *eigrp, @@ -989,7 +985,7 @@ static int eigrp_check_network_mask(struct eigrp_interface *ei, return 0; } -int eigrp_unack_packet_retrans(struct thread *thread) +void eigrp_unack_packet_retrans(struct thread *thread) { struct eigrp_neighbor *nbr; nbr = (struct eigrp_neighbor *)THREAD_ARG(thread); @@ -1005,8 +1001,10 @@ int eigrp_unack_packet_retrans(struct thread *thread) eigrp_fifo_push(nbr->ei->obuf, duplicate); ep->retrans_counter++; - if (ep->retrans_counter == EIGRP_PACKET_RETRANS_MAX) - return eigrp_retrans_count_exceeded(ep, nbr); + if (ep->retrans_counter == EIGRP_PACKET_RETRANS_MAX) { + eigrp_retrans_count_exceeded(ep, nbr); + return; + } /*Start retransmission timer*/ thread_add_timer(master, eigrp_unack_packet_retrans, nbr, @@ -1021,11 +1019,9 @@ int eigrp_unack_packet_retrans(struct thread *thread) thread_add_write(master, eigrp_write, nbr->ei->eigrp, nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write); } - - return 0; } -int eigrp_unack_multicast_packet_retrans(struct thread *thread) +void eigrp_unack_multicast_packet_retrans(struct thread *thread) { struct eigrp_neighbor *nbr; nbr = (struct eigrp_neighbor *)THREAD_ARG(thread); @@ -1040,8 +1036,10 @@ int eigrp_unack_multicast_packet_retrans(struct thread *thread) eigrp_fifo_push(nbr->ei->obuf, duplicate); ep->retrans_counter++; - if (ep->retrans_counter == EIGRP_PACKET_RETRANS_MAX) - return eigrp_retrans_count_exceeded(ep, nbr); + if (ep->retrans_counter == EIGRP_PACKET_RETRANS_MAX) { + eigrp_retrans_count_exceeded(ep, nbr); + return; + } /*Start retransmission timer*/ thread_add_timer(master, eigrp_unack_multicast_packet_retrans, @@ -1056,8 +1054,6 @@ int eigrp_unack_multicast_packet_retrans(struct thread *thread) thread_add_write(master, eigrp_write, nbr->ei->eigrp, nbr->ei->eigrp->fd, &nbr->ei->eigrp->t_write); } - - return 0; } /* Get packet from tail of fifo. */ diff --git a/eigrpd/eigrp_packet.h b/eigrpd/eigrp_packet.h index cb69bc26b..f65917666 100644 --- a/eigrpd/eigrp_packet.h +++ b/eigrpd/eigrp_packet.h @@ -33,8 +33,8 @@ #define _ZEBRA_EIGRP_PACKET_H /*Prototypes*/ -extern int eigrp_read(struct thread *); -extern int eigrp_write(struct thread *); +extern void eigrp_read(struct thread *thread); +extern void eigrp_write(struct thread *thread); extern struct eigrp_packet *eigrp_packet_new(size_t size, struct eigrp_neighbor *nbr); @@ -66,8 +66,8 @@ extern uint16_t eigrp_add_authTLV_MD5_to_stream(struct stream *s, extern uint16_t eigrp_add_authTLV_SHA256_to_stream(struct stream *s, struct eigrp_interface *ei); -extern int eigrp_unack_packet_retrans(struct thread *thread); -extern int eigrp_unack_multicast_packet_retrans(struct thread *thread); +extern void eigrp_unack_packet_retrans(struct thread *thread); +extern void eigrp_unack_multicast_packet_retrans(struct thread *thread); /* * untill there is reason to have their own header, these externs are found in @@ -80,7 +80,7 @@ extern void eigrp_hello_send_ack(struct eigrp_neighbor *nbr); extern void eigrp_hello_receive(struct eigrp *eigrp, struct ip *iph, struct eigrp_header *eigrph, struct stream *s, struct eigrp_interface *ei, int size); -extern int eigrp_hello_timer(struct thread *thread); +extern void eigrp_hello_timer(struct thread *thread); /* * These externs are found in eigrp_update.c @@ -96,7 +96,7 @@ extern void eigrp_update_send_all(struct eigrp *eigrp, struct eigrp_interface *exception); extern void eigrp_update_send_init(struct eigrp_neighbor *nbr); extern void eigrp_update_send_EOT(struct eigrp_neighbor *nbr); -extern int eigrp_update_send_GR_thread(struct thread *thread); +extern void eigrp_update_send_GR_thread(struct thread *thread); extern void eigrp_update_send_GR(struct eigrp_neighbor *nbr, enum GR_type gr_type, struct vty *vty); extern void eigrp_update_send_interface_GR(struct eigrp_interface *ei, diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c index 8a9eea8a7..5848632d8 100644 --- a/eigrpd/eigrp_update.c +++ b/eigrpd/eigrp_update.c @@ -910,7 +910,7 @@ static void eigrp_update_send_GR_part(struct eigrp_neighbor *nbr) * * Uses nbr_gr_packet_type and t_nbr_send_gr from neighbor. */ -int eigrp_update_send_GR_thread(struct thread *thread) +void eigrp_update_send_GR_thread(struct thread *thread) { struct eigrp_neighbor *nbr; @@ -923,7 +923,7 @@ int eigrp_update_send_GR_thread(struct thread *thread) if (nbr->retrans_queue->count > 0) { thread_add_timer_msec(master, eigrp_update_send_GR_thread, nbr, 10, &nbr->t_nbr_send_gr); - return 0; + return; } /* send GR EIGRP packet chunk */ @@ -933,8 +933,6 @@ int eigrp_update_send_GR_thread(struct thread *thread) if (nbr->nbr_gr_packet_type != EIGRP_PACKET_PART_LAST) { thread_execute(master, eigrp_update_send_GR_thread, nbr, 0); } - - return 0; } /** |