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/eigrp_packet.c | |
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/eigrp_packet.c')
-rw-r--r-- | eigrpd/eigrp_packet.c | 44 |
1 files changed, 20 insertions, 24 deletions
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. */ |