summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-02-23 01:04:25 +0100
committerDonald Sharp <sharpd@nvidia.com>2022-02-24 01:56:04 +0100
commitcc9f21da2218d95567eff1501482ce58e6600f54 (patch)
treed579c9754161d874bad6eb09c67821b65fb559ca /ospfd
parentMerge pull request #10621 from donaldsharp/cov_fun (diff)
downloadfrr-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 'ospfd')
-rw-r--r--ospfd/ospf_abr.c4
-rw-r--r--ospfd/ospf_apiserver.c40
-rw-r--r--ospfd/ospf_apiserver.h8
-rw-r--r--ospfd/ospf_asbr.c8
-rw-r--r--ospfd/ospf_ase.c4
-rw-r--r--ospfd/ospf_gr.c4
-rw-r--r--ospfd/ospf_gr_helper.c3
-rw-r--r--ospfd/ospf_ism.c12
-rw-r--r--ospfd/ospf_ism.h4
-rw-r--r--ospfd/ospf_ldp_sync.c3
-rw-r--r--ospfd/ospf_lsa.c22
-rw-r--r--ospfd/ospf_lsa.h4
-rw-r--r--ospfd/ospf_nsm.c12
-rw-r--r--ospfd/ospf_nsm.h2
-rw-r--r--ospfd/ospf_opaque.c84
-rw-r--r--ospfd/ospf_packet.c40
-rw-r--r--ospfd/ospf_packet.h10
-rw-r--r--ospfd/ospf_spf.c4
-rw-r--r--ospfd/ospf_sr.c4
-rw-r--r--ospfd/ospf_zebra.c12
-rw-r--r--ospfd/ospfd.c4
21 files changed, 98 insertions, 190 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index 8e59bd9eb..7aa3a27c6 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -1829,7 +1829,7 @@ void ospf_abr_task(struct ospf *ospf)
zlog_debug("ospf_abr_task(): Stop");
}
-static int ospf_abr_task_timer(struct thread *thread)
+static void ospf_abr_task_timer(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
@@ -1843,8 +1843,6 @@ static int ospf_abr_task_timer(struct thread *thread)
ospf_abr_task(ospf);
ospf_abr_nssa_task(ospf); /* if nssa-abr, then scan Type-7 LSDB */
-
- return 0;
}
void ospf_schedule_abr_task(struct ospf *ospf)
diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index a33ca9577..93e3b9a8e 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -362,12 +362,11 @@ void ospf_apiserver_free(struct ospf_apiserver *apiserv)
XFREE(MTYPE_OSPF_APISERVER, apiserv);
}
-int ospf_apiserver_read(struct thread *thread)
+void ospf_apiserver_read(struct thread *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
int fd;
- int rc = -1;
enum event event;
apiserv = THREAD_ARG(thread);
@@ -396,7 +395,7 @@ int ospf_apiserver_read(struct thread *thread)
else {
zlog_warn("ospf_apiserver_read: Unknown fd(%d)", fd);
ospf_apiserver_free(apiserv);
- goto out;
+ return;
}
/* Read message from fd. */
@@ -408,25 +407,22 @@ int ospf_apiserver_read(struct thread *thread)
/* Perform cleanup. */
ospf_apiserver_free(apiserv);
- goto out;
+ return;
}
if (IS_DEBUG_OSPF_EVENT)
msg_print(msg);
/* Dispatch to corresponding message handler. */
- rc = ospf_apiserver_handle_msg(apiserv, msg);
+ ospf_apiserver_handle_msg(apiserv, msg);
/* Prepare for next message, add read thread. */
ospf_apiserver_event(event, fd, apiserv);
msg_free(msg);
-
-out:
- return rc;
}
-int ospf_apiserver_sync_write(struct thread *thread)
+void ospf_apiserver_sync_write(struct thread *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
@@ -455,7 +451,7 @@ int ospf_apiserver_sync_write(struct thread *thread)
if (!msg) {
zlog_warn(
"API: ospf_apiserver_sync_write: No message in Sync-FIFO?");
- return 0;
+ return;
}
if (IS_DEBUG_OSPF_EVENT)
@@ -485,12 +481,10 @@ out:
/* Perform cleanup and disconnect with peer */
ospf_apiserver_free(apiserv);
}
-
- return rc;
}
-int ospf_apiserver_async_write(struct thread *thread)
+void ospf_apiserver_async_write(struct thread *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
@@ -519,7 +513,7 @@ int ospf_apiserver_async_write(struct thread *thread)
if (!msg) {
zlog_warn(
"API: ospf_apiserver_async_write: No message in Async-FIFO?");
- return 0;
+ return;
}
if (IS_DEBUG_OSPF_EVENT)
@@ -549,8 +543,6 @@ out:
/* Perform cleanup and disconnect with peer */
ospf_apiserver_free(apiserv);
}
-
- return rc;
}
@@ -593,7 +585,7 @@ int ospf_apiserver_serv_sock_family(unsigned short port, int family)
/* Accept connection request from external applications. For each
accepted connection allocate own connection instance. */
-int ospf_apiserver_accept(struct thread *thread)
+void ospf_apiserver_accept(struct thread *thread)
{
int accept_sock;
int new_sync_sock;
@@ -617,7 +609,7 @@ int ospf_apiserver_accept(struct thread *thread)
if (new_sync_sock < 0) {
zlog_warn("ospf_apiserver_accept: accept: %s",
safe_strerror(errno));
- return -1;
+ return;
}
/* Get port address and port number of peer to make reverse connection.
@@ -632,7 +624,7 @@ int ospf_apiserver_accept(struct thread *thread)
zlog_warn("ospf_apiserver_accept: getpeername: %s",
safe_strerror(errno));
close(new_sync_sock);
- return -1;
+ return;
}
if (IS_DEBUG_OSPF_EVENT)
@@ -652,7 +644,7 @@ int ospf_apiserver_accept(struct thread *thread)
&peer_async.sin_addr,
ntohs(peer_async.sin_port));
close(new_sync_sock);
- return -1;
+ return;
}
new_async_sock = socket(AF_INET, SOCK_STREAM, 0);
@@ -660,7 +652,7 @@ int ospf_apiserver_accept(struct thread *thread)
zlog_warn("ospf_apiserver_accept: socket: %s",
safe_strerror(errno));
close(new_sync_sock);
- return -1;
+ return;
}
ret = connect(new_async_sock, (struct sockaddr *)&peer_async,
@@ -671,7 +663,7 @@ int ospf_apiserver_accept(struct thread *thread)
safe_strerror(errno));
close(new_sync_sock);
close(new_async_sock);
- return -1;
+ return;
}
#ifdef USE_ASYNC_READ
@@ -683,7 +675,7 @@ int ospf_apiserver_accept(struct thread *thread)
safe_strerror(errno));
close(new_sync_sock);
close(new_async_sock);
- return -1;
+ return;
}
#endif /* USE_ASYNC_READ */
@@ -705,8 +697,6 @@ int ospf_apiserver_accept(struct thread *thread)
if (IS_DEBUG_OSPF_EVENT)
zlog_debug("API: New apiserv(%p), total#(%d)", (void *)apiserv,
apiserver_list->count);
-
- return 0;
}
diff --git a/ospfd/ospf_apiserver.h b/ospfd/ospf_apiserver.h
index 544a32a28..3994c8d50 100644
--- a/ospfd/ospf_apiserver.h
+++ b/ospfd/ospf_apiserver.h
@@ -91,10 +91,10 @@ extern void ospf_apiserver_free(struct ospf_apiserver *apiserv);
extern void ospf_apiserver_event(enum event event, int fd,
struct ospf_apiserver *apiserv);
extern int ospf_apiserver_serv_sock_family(unsigned short port, int family);
-extern int ospf_apiserver_accept(struct thread *thread);
-extern int ospf_apiserver_read(struct thread *thread);
-extern int ospf_apiserver_sync_write(struct thread *thread);
-extern int ospf_apiserver_async_write(struct thread *thread);
+extern void ospf_apiserver_accept(struct thread *thread);
+extern void ospf_apiserver_read(struct thread *thread);
+extern void ospf_apiserver_sync_write(struct thread *thread);
+extern void ospf_apiserver_async_write(struct thread *thread);
extern int ospf_apiserver_send_reply(struct ospf_apiserver *apiserv,
uint32_t seqnr, uint8_t rc);
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index db78e6d2d..70581b908 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -279,7 +279,7 @@ void ospf_asbr_status_update(struct ospf *ospf, uint8_t status)
/* If there's redistribution configured, we need to refresh external
* LSAs in order to install Type-7 and flood to all NSSA Areas
*/
-static int ospf_asbr_nssa_redist_update_timer(struct thread *thread)
+static void ospf_asbr_nssa_redist_update_timer(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
int type;
@@ -305,8 +305,6 @@ static int ospf_asbr_nssa_redist_update_timer(struct thread *thread)
}
ospf_external_lsa_refresh_default(ospf);
-
- return 0;
}
void ospf_schedule_asbr_nssa_redist_update(struct ospf *ospf)
@@ -1064,7 +1062,7 @@ static void ospf_handle_external_aggr_update(struct ospf *ospf)
}
}
-static int ospf_asbr_external_aggr_process(struct thread *thread)
+static void ospf_asbr_external_aggr_process(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
int operation = 0;
@@ -1086,8 +1084,6 @@ static int ospf_asbr_external_aggr_process(struct thread *thread)
default:
break;
}
-
- return OSPF_SUCCESS;
}
static void ospf_external_aggr_timer(struct ospf *ospf,
struct ospf_external_aggr_rt *aggr,
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index e9fb891d7..23c7a1e70 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -564,7 +564,7 @@ static int ospf_ase_compare_tables(struct ospf *ospf,
return 0;
}
-static int ospf_ase_calculate_timer(struct thread *t)
+static void ospf_ase_calculate_timer(struct thread *t)
{
struct ospf *ospf;
struct ospf_lsa *lsa;
@@ -631,8 +631,6 @@ static int ospf_ase_calculate_timer(struct thread *t)
ospf_zebra_gr_disable(ospf);
ospf->gr_info.finishing_restart = false;
}
-
- return 0;
}
void ospf_ase_calculate_schedule(struct ospf *ospf)
diff --git a/ospfd/ospf_gr.c b/ospfd/ospf_gr.c
index 6bfe48145..ee1ca256e 100644
--- a/ospfd/ospf_gr.c
+++ b/ospfd/ospf_gr.c
@@ -510,14 +510,12 @@ void ospf_gr_check_adjs(struct ospf *ospf)
}
/* Handling of grace period expiry. */
-static int ospf_gr_grace_period_expired(struct thread *thread)
+static void ospf_gr_grace_period_expired(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
ospf->gr_info.t_grace_period = NULL;
ospf_gr_restart_exit(ospf, "grace period has expired");
-
- return 0;
}
/*
diff --git a/ospfd/ospf_gr_helper.c b/ospfd/ospf_gr_helper.c
index 5eca59175..92236cf44 100644
--- a/ospfd/ospf_gr_helper.c
+++ b/ospfd/ospf_gr_helper.c
@@ -346,14 +346,13 @@ static int ospf_extract_grace_lsa_fields(struct ospf_lsa *lsa,
* Returns:
* Nothing
*/
-static int ospf_handle_grace_timer_expiry(struct thread *thread)
+static void ospf_handle_grace_timer_expiry(struct thread *thread)
{
struct ospf_neighbor *nbr = THREAD_ARG(thread);
nbr->gr_helper_info.t_grace_timer = NULL;
ospf_gr_helper_exit(nbr, OSPF_GR_HELPER_GRACE_TIMEOUT);
- return OSPF_GR_SUCCESS;
}
/*
diff --git a/ospfd/ospf_ism.c b/ospfd/ospf_ism.c
index 1850d946b..97da61034 100644
--- a/ospfd/ospf_ism.c
+++ b/ospfd/ospf_ism.c
@@ -248,7 +248,7 @@ int ospf_dr_election(struct ospf_interface *oi)
}
-int ospf_hello_timer(struct thread *thread)
+void ospf_hello_timer(struct thread *thread)
{
struct ospf_interface *oi;
@@ -263,11 +263,9 @@ int ospf_hello_timer(struct thread *thread)
/* Hello timer set. */
OSPF_HELLO_TIMER_ON(oi);
-
- return 0;
}
-static int ospf_wait_timer(struct thread *thread)
+static void ospf_wait_timer(struct thread *thread)
{
struct ospf_interface *oi;
@@ -278,8 +276,6 @@ static int ospf_wait_timer(struct thread *thread)
zlog_debug("ISM[%s]: Timer (Wait timer expire)", IF_NAME(oi));
OSPF_ISM_EVENT_SCHEDULE(oi, ISM_WaitTimer);
-
- return 0;
}
/* Hook function called after ospf ISM event is occurred. And vty's
@@ -575,7 +571,7 @@ static void ism_change_state(struct ospf_interface *oi, int state)
}
/* Execute ISM event process. */
-int ospf_ism_event(struct thread *thread)
+void ospf_ism_event(struct thread *thread)
{
int event;
int next_state;
@@ -601,6 +597,4 @@ int ospf_ism_event(struct thread *thread)
/* Make sure timer is set. */
ism_timer_set(oi);
-
- return 0;
}
diff --git a/ospfd/ospf_ism.h b/ospfd/ospf_ism.h
index 5d0f95aed..35fbd15d0 100644
--- a/ospfd/ospf_ism.h
+++ b/ospfd/ospf_ism.h
@@ -90,9 +90,9 @@
thread_execute(master, ospf_ism_event, (I), (E))
/* Prototypes. */
-extern int ospf_ism_event(struct thread *);
+extern void ospf_ism_event(struct thread *thread);
extern void ism_change_status(struct ospf_interface *, int);
-extern int ospf_hello_timer(struct thread *thread);
+extern void ospf_hello_timer(struct thread *thread);
extern int ospf_dr_election(struct ospf_interface *oi);
DECLARE_HOOK(ospf_ism_change,
diff --git a/ospfd/ospf_ldp_sync.c b/ospfd/ospf_ldp_sync.c
index 247ceb0a0..9b3498bc1 100644
--- a/ospfd/ospf_ldp_sync.c
+++ b/ospfd/ospf_ldp_sync.c
@@ -353,7 +353,7 @@ static int ospf_ldp_sync_ism_change(struct ospf_interface *oi, int state,
/*
* LDP-SYNC holddown timer routines
*/
-static int ospf_ldp_sync_holddown_timer(struct thread *thread)
+static void ospf_ldp_sync_holddown_timer(struct thread *thread)
{
struct interface *ifp;
struct ospf_if_params *params;
@@ -375,7 +375,6 @@ static int ospf_ldp_sync_holddown_timer(struct thread *thread)
ospf_if_recalculate_output_cost(ifp);
}
- return 0;
}
void ospf_ldp_sync_holddown_timer_add(struct interface *ifp)
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index e3ba1f1dd..3eb91d0eb 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -734,7 +734,7 @@ void ospf_router_lsa_body_set(struct stream **s, struct ospf_area *area)
stream_putw_at(*s, putp, cnt);
}
-static int ospf_stub_router_timer(struct thread *t)
+static void ospf_stub_router_timer(struct thread *t)
{
struct ospf_area *area = THREAD_ARG(t);
@@ -746,13 +746,11 @@ static int ospf_stub_router_timer(struct thread *t)
* clobber an administratively set stub-router state though.
*/
if (CHECK_FLAG(area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED))
- return 0;
+ return;
UNSET_FLAG(area->stub_router_state, OSPF_AREA_IS_STUB_ROUTED);
ospf_router_lsa_update_area(area);
-
- return 0;
}
static void ospf_stub_router_check(struct ospf_area *area)
@@ -3025,7 +3023,7 @@ int ospf_check_nbr_status(struct ospf *ospf)
}
-static int ospf_maxage_lsa_remover(struct thread *thread)
+static void ospf_maxage_lsa_remover(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct ospf_lsa *lsa, *old;
@@ -3062,7 +3060,7 @@ static int ospf_maxage_lsa_remover(struct thread *thread)
ospf_maxage_lsa_remover, 0);
route_unlock_node(
rn); /* route_top/route_next */
- return 0;
+ return;
}
/* Remove LSA from the LSDB */
@@ -3118,8 +3116,6 @@ static int ospf_maxage_lsa_remover(struct thread *thread)
if (reschedule)
OSPF_TIMER_ON(ospf->t_maxage, ospf_maxage_lsa_remover,
ospf->maxage_delay);
-
- return 0;
}
/* This function checks whether an LSA with initial sequence number should be
@@ -3275,7 +3271,7 @@ static int ospf_lsa_maxage_walker_remover(struct ospf *ospf,
}
/* Periodical check of MaxAge LSA. */
-int ospf_lsa_maxage_walker(struct thread *thread)
+void ospf_lsa_maxage_walker(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct route_node *rn;
@@ -3312,7 +3308,6 @@ int ospf_lsa_maxage_walker(struct thread *thread)
OSPF_TIMER_ON(ospf->t_maxage_walker, ospf_lsa_maxage_walker,
OSPF_LSA_MAXAGE_CHECK_INTERVAL);
- return 0;
}
struct ospf_lsa *ospf_lsa_lookup_by_prefix(struct ospf_lsdb *lsdb, uint8_t type,
@@ -3773,7 +3768,7 @@ struct lsa_action {
struct ospf_lsa *lsa;
};
-static int ospf_lsa_action(struct thread *t)
+static void ospf_lsa_action(struct thread *t)
{
struct lsa_action *data;
@@ -3794,7 +3789,6 @@ static int ospf_lsa_action(struct thread *t)
ospf_lsa_unlock(&data->lsa); /* Message */
XFREE(MTYPE_OSPF_MESSAGE, data);
- return 0;
}
void ospf_schedule_lsa_flood_area(struct ospf_area *area, struct ospf_lsa *lsa)
@@ -3965,7 +3959,7 @@ void ospf_refresher_unregister_lsa(struct ospf *ospf, struct ospf_lsa *lsa)
}
}
-int ospf_lsa_refresh_walker(struct thread *t)
+void ospf_lsa_refresh_walker(struct thread *t)
{
struct list *refresh_list;
struct listnode *node, *nnode;
@@ -4044,8 +4038,6 @@ int ospf_lsa_refresh_walker(struct thread *t)
if (IS_DEBUG_OSPF(lsa, LSA_REFRESH))
zlog_debug("LSA[Refresh]: ospf_lsa_refresh_walker(): end");
-
- return 0;
}
/* Flush the LSAs for the specific area */
diff --git a/ospfd/ospf_lsa.h b/ospfd/ospf_lsa.h
index d04d11841..4b3be1538 100644
--- a/ospfd/ospf_lsa.h
+++ b/ospfd/ospf_lsa.h
@@ -308,7 +308,7 @@ extern struct ospf_lsa *ospf_lsa_lookup_by_prefix(struct ospf_lsdb *, uint8_t,
extern void ospf_lsa_maxage(struct ospf *, struct ospf_lsa *);
extern uint32_t get_metric(uint8_t *);
-extern int ospf_lsa_maxage_walker(struct thread *);
+extern void ospf_lsa_maxage_walker(struct thread *thread);
extern struct ospf_lsa *ospf_lsa_refresh(struct ospf *, struct ospf_lsa *);
extern void ospf_external_lsa_refresh_default(struct ospf *);
@@ -328,7 +328,7 @@ extern void ospf_schedule_lsa_flush_area(struct ospf_area *, struct ospf_lsa *);
extern void ospf_refresher_register_lsa(struct ospf *, struct ospf_lsa *);
extern void ospf_refresher_unregister_lsa(struct ospf *, struct ospf_lsa *);
-extern int ospf_lsa_refresh_walker(struct thread *);
+extern void ospf_lsa_refresh_walker(struct thread *thread);
extern void ospf_lsa_maxage_delete(struct ospf *, struct ospf_lsa *);
diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c
index e3cf1cfc8..c538d1a09 100644
--- a/ospfd/ospf_nsm.c
+++ b/ospfd/ospf_nsm.c
@@ -59,7 +59,7 @@ DEFINE_HOOK(ospf_nsm_change,
static void nsm_clear_adj(struct ospf_neighbor *);
/* OSPF NSM Timer functions. */
-static int ospf_inactivity_timer(struct thread *thread)
+static void ospf_inactivity_timer(struct thread *thread)
{
struct ospf_neighbor *nbr;
@@ -84,11 +84,9 @@ static int ospf_inactivity_timer(struct thread *thread)
OSPF_NSM_TIMER_ON(nbr->t_inactivity, ospf_inactivity_timer,
nbr->v_inactivity);
}
-
- return 0;
}
-static int ospf_db_desc_timer(struct thread *thread)
+static void ospf_db_desc_timer(struct thread *thread)
{
struct ospf_neighbor *nbr;
@@ -106,8 +104,6 @@ static int ospf_db_desc_timer(struct thread *thread)
/* DD Retransmit timer set. */
OSPF_NSM_TIMER_ON(nbr->t_db_desc, ospf_db_desc_timer, nbr->v_db_desc);
-
- return 0;
}
/* Hook function called after ospf NSM event is occurred.
@@ -776,7 +772,7 @@ static void nsm_change_state(struct ospf_neighbor *nbr, int state)
}
/* Execute NSM event process. */
-int ospf_nsm_event(struct thread *thread)
+void ospf_nsm_event(struct thread *thread)
{
int event;
int next_state;
@@ -846,8 +842,6 @@ int ospf_nsm_event(struct thread *thread)
*/
if (nbr->state == NSM_Deleted)
ospf_nbr_delete(nbr);
-
- return 0;
}
/* Check loading state. */
diff --git a/ospfd/ospf_nsm.h b/ospfd/ospf_nsm.h
index 798325f79..0b40b1f42 100644
--- a/ospfd/ospf_nsm.h
+++ b/ospfd/ospf_nsm.h
@@ -70,7 +70,7 @@
thread_execute(master, ospf_nsm_event, (N), (E))
/* Prototypes. */
-extern int ospf_nsm_event(struct thread *);
+extern void ospf_nsm_event(struct thread *);
extern void ospf_check_nbr_loading(struct ospf_neighbor *);
extern int ospf_db_summary_isempty(struct ospf_neighbor *);
extern int ospf_db_summary_count(struct ospf_neighbor *);
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 4670316db..b781c9edc 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -1286,9 +1286,9 @@ out:
* Followings are Opaque-LSA origination/refresh management functions.
*------------------------------------------------------------------------*/
-static int ospf_opaque_type9_lsa_originate(struct thread *t);
-static int ospf_opaque_type10_lsa_originate(struct thread *t);
-static int ospf_opaque_type11_lsa_originate(struct thread *t);
+static void ospf_opaque_type9_lsa_originate(struct thread *t);
+static void ospf_opaque_type10_lsa_originate(struct thread *t);
+static void ospf_opaque_type11_lsa_originate(struct thread *t);
static void ospf_opaque_lsa_reoriginate_resume(struct list *listtop, void *arg);
void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
@@ -1460,10 +1460,9 @@ void ospf_opaque_lsa_originate_schedule(struct ospf_interface *oi, int *delay0)
*delay0 = delay;
}
-static int ospf_opaque_type9_lsa_originate(struct thread *t)
+static void ospf_opaque_type9_lsa_originate(struct thread *t)
{
struct ospf_interface *oi;
- int rc;
oi = THREAD_ARG(t);
oi->t_opaque_lsa_self = NULL;
@@ -1472,15 +1471,12 @@ static int ospf_opaque_type9_lsa_originate(struct thread *t)
zlog_debug("Timer[Type9-LSA]: Originate Opaque-LSAs for OI %s",
IF_NAME(oi));
- rc = opaque_lsa_originate_callback(ospf_opaque_type9_funclist, oi);
-
- return rc;
+ opaque_lsa_originate_callback(ospf_opaque_type9_funclist, oi);
}
-static int ospf_opaque_type10_lsa_originate(struct thread *t)
+static void ospf_opaque_type10_lsa_originate(struct thread *t)
{
struct ospf_area *area;
- int rc;
area = THREAD_ARG(t);
area->t_opaque_lsa_self = NULL;
@@ -1490,15 +1486,12 @@ static int ospf_opaque_type10_lsa_originate(struct thread *t)
"Timer[Type10-LSA]: Originate Opaque-LSAs for Area %pI4",
&area->area_id);
- rc = opaque_lsa_originate_callback(ospf_opaque_type10_funclist, area);
-
- return rc;
+ opaque_lsa_originate_callback(ospf_opaque_type10_funclist, area);
}
-static int ospf_opaque_type11_lsa_originate(struct thread *t)
+static void ospf_opaque_type11_lsa_originate(struct thread *t)
{
struct ospf *top;
- int rc;
top = THREAD_ARG(t);
top->t_opaque_lsa_self = NULL;
@@ -1507,9 +1500,7 @@ static int ospf_opaque_type11_lsa_originate(struct thread *t)
zlog_debug(
"Timer[Type11-LSA]: Originate AS-External Opaque-LSAs");
- rc = opaque_lsa_originate_callback(ospf_opaque_type11_funclist, top);
-
- return rc;
+ opaque_lsa_originate_callback(ospf_opaque_type11_funclist, top);
}
static void ospf_opaque_lsa_reoriginate_resume(struct list *listtop, void *arg)
@@ -1665,10 +1656,10 @@ struct ospf_lsa *ospf_opaque_lsa_refresh(struct ospf_lsa *lsa)
static struct ospf_lsa *pseudo_lsa(struct ospf_interface *oi,
struct ospf_area *area, uint8_t lsa_type,
uint8_t opaque_type);
-static int ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t);
-static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t);
-static int ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t);
-static int ospf_opaque_lsa_refresh_timer(struct thread *t);
+static void ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t);
+static void ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t);
+static void ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t);
+static void ospf_opaque_lsa_refresh_timer(struct thread *t);
void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
uint8_t lsa_type, uint8_t opaque_type)
@@ -1679,7 +1670,7 @@ void ospf_opaque_lsa_reoriginate_schedule(void *lsa_type_dependent,
struct ospf_lsa *lsa;
struct opaque_info_per_type *oipt;
- int (*func)(struct thread * t) = NULL;
+ void (*func)(struct thread * t) = NULL;
int delay;
switch (lsa_type) {
@@ -1846,13 +1837,12 @@ static struct ospf_lsa *pseudo_lsa(struct ospf_interface *oi,
return &lsa;
}
-static int ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
+static void ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
{
struct opaque_info_per_type *oipt;
struct ospf_opaque_functab *functab;
struct ospf *top;
struct ospf_interface *oi;
- int rc = -1;
oipt = THREAD_ARG(t);
@@ -1861,7 +1851,7 @@ static int ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
flog_warn(
EC_OSPF_LSA,
"ospf_opaque_type9_lsa_reoriginate_timer: No associated function?");
- goto out;
+ return;
}
oi = (struct ospf_interface *)oipt->owner;
@@ -1869,7 +1859,7 @@ static int ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
flog_warn(
EC_OSPF_LSA,
"ospf_opaque_type9_lsa_reoriginate_timer: Something wrong?");
- goto out;
+ return;
}
if (!CHECK_FLAG(top->config, OSPF_OPAQUE_CAPABLE)
@@ -1881,8 +1871,7 @@ static int ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
oipt->opaque_type);
oipt->status = PROC_SUSPEND;
- rc = 0;
- goto out;
+ return;
}
if (IS_DEBUG_OSPF_EVENT)
@@ -1890,12 +1879,10 @@ static int ospf_opaque_type9_lsa_reoriginate_timer(struct thread *t)
"Timer[Type9-LSA]: Re-originate Opaque-LSAs (opaque-type=%u) for OI (%s)",
oipt->opaque_type, IF_NAME(oi));
- rc = (*functab->lsa_originator)(oi);
-out:
- return rc;
+ (*functab->lsa_originator)(oi);
}
-static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
+static void ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
{
struct opaque_info_per_type *oipt;
struct ospf_opaque_functab *functab;
@@ -1903,7 +1890,7 @@ static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
struct ospf *top;
struct ospf_area *area;
struct ospf_interface *oi;
- int n, rc = -1;
+ int n;
oipt = THREAD_ARG(t);
@@ -1912,7 +1899,7 @@ static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
flog_warn(
EC_OSPF_LSA,
"ospf_opaque_type10_lsa_reoriginate_timer: No associated function?");
- goto out;
+ return;
}
area = (struct ospf_area *)oipt->owner;
@@ -1920,7 +1907,7 @@ static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
flog_warn(
EC_OSPF_LSA,
"ospf_opaque_type10_lsa_reoriginate_timer: Something wrong?");
- goto out;
+ return;
}
/* There must be at least one "opaque-capable, full-state" neighbor. */
@@ -1937,8 +1924,7 @@ static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
oipt->opaque_type);
oipt->status = PROC_SUSPEND;
- rc = 0;
- goto out;
+ return;
}
if (IS_DEBUG_OSPF_EVENT)
@@ -1946,17 +1932,14 @@ static int ospf_opaque_type10_lsa_reoriginate_timer(struct thread *t)
"Timer[Type10-LSA]: Re-originate Opaque-LSAs (opaque-type=%u) for Area %pI4",
oipt->opaque_type, &area->area_id);
- rc = (*functab->lsa_originator)(area);
-out:
- return rc;
+ (*functab->lsa_originator)(area);
}
-static int ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t)
+static void ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t)
{
struct opaque_info_per_type *oipt;
struct ospf_opaque_functab *functab;
struct ospf *top;
- int rc = -1;
oipt = THREAD_ARG(t);
@@ -1965,14 +1948,14 @@ static int ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t)
flog_warn(
EC_OSPF_LSA,
"ospf_opaque_type11_lsa_reoriginate_timer: No associated function?");
- goto out;
+ return;
}
if ((top = (struct ospf *)oipt->owner) == NULL) {
flog_warn(
EC_OSPF_LSA,
"ospf_opaque_type11_lsa_reoriginate_timer: Something wrong?");
- goto out;
+ return;
}
if (!CHECK_FLAG(top->config, OSPF_OPAQUE_CAPABLE)) {
@@ -1982,8 +1965,7 @@ static int ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t)
oipt->opaque_type);
oipt->status = PROC_SUSPEND;
- rc = 0;
- goto out;
+ return;
}
if (IS_DEBUG_OSPF_EVENT)
@@ -1991,9 +1973,7 @@ static int ospf_opaque_type11_lsa_reoriginate_timer(struct thread *t)
"Timer[Type11-LSA]: Re-originate Opaque-LSAs (opaque-type=%u).",
oipt->opaque_type);
- rc = (*functab->lsa_originator)(top);
-out:
- return rc;
+ (*functab->lsa_originator)(top);
}
void ospf_opaque_lsa_refresh_schedule(struct ospf_lsa *lsa0)
@@ -2064,7 +2044,7 @@ out:
return;
}
-static int ospf_opaque_lsa_refresh_timer(struct thread *t)
+static void ospf_opaque_lsa_refresh_timer(struct thread *t)
{
struct opaque_info_per_id *oipi;
struct ospf_opaque_functab *functab;
@@ -2079,8 +2059,6 @@ static int ospf_opaque_lsa_refresh_timer(struct thread *t)
if ((functab = oipi->opqctl_type->functab) != NULL)
if (functab->lsa_refresher != NULL)
(*functab->lsa_refresher)(lsa);
-
- return 0;
}
void ospf_opaque_lsa_flush_schedule(struct ospf_lsa *lsa0)
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index e17e53109..c2bd7a079 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -449,7 +449,7 @@ static int ospf_make_md5_digest(struct ospf_interface *oi,
}
-static int ospf_ls_req_timer(struct thread *thread)
+static void ospf_ls_req_timer(struct thread *thread)
{
struct ospf_neighbor *nbr;
@@ -462,8 +462,6 @@ static int ospf_ls_req_timer(struct thread *thread)
/* Set Link State Request retransmission timer. */
OSPF_NSM_TIMER_ON(nbr->t_ls_req, ospf_ls_req_timer, nbr->v_ls_req);
-
- return 0;
}
void ospf_ls_req_event(struct ospf_neighbor *nbr)
@@ -474,7 +472,7 @@ void ospf_ls_req_event(struct ospf_neighbor *nbr)
/* Cyclic timer function. Fist registered in ospf_nbr_new () in
ospf_neighbor.c */
-int ospf_ls_upd_timer(struct thread *thread)
+void ospf_ls_upd_timer(struct thread *thread)
{
struct ospf_neighbor *nbr;
@@ -530,11 +528,9 @@ int ospf_ls_upd_timer(struct thread *thread)
/* Set LS Update retransmission timer. */
OSPF_NSM_TIMER_ON(nbr->t_ls_upd, ospf_ls_upd_timer, nbr->v_ls_upd);
-
- return 0;
}
-int ospf_ls_ack_timer(struct thread *thread)
+void ospf_ls_ack_timer(struct thread *thread)
{
struct ospf_interface *oi;
@@ -547,8 +543,6 @@ int ospf_ls_ack_timer(struct thread *thread)
/* Set LS Ack timer. */
OSPF_ISM_TIMER_ON(oi->t_ls_ack, ospf_ls_ack_timer, oi->v_ls_ack);
-
- return 0;
}
#ifdef WANT_OSPF_WRITE_FRAGMENT
@@ -625,7 +619,7 @@ static void ospf_write_frags(int fd, struct ospf_packet *op, struct ip *iph,
}
#endif /* WANT_OSPF_WRITE_FRAGMENT */
-static int ospf_write(struct thread *thread)
+static void ospf_write(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct ospf_interface *oi;
@@ -657,7 +651,7 @@ static int ospf_write(struct thread *thread)
zlog_debug(
"ospf_write failed to send, fd %d, instance %u",
ospf->fd, ospf->oi_running);
- return -1;
+ return;
}
node = listhead(ospf->oi_write_q);
@@ -876,8 +870,6 @@ static int ospf_write(struct thread *thread)
if (!list_isempty(ospf->oi_write_q))
thread_add_write(master, ospf_write, ospf, ospf->fd,
&ospf->t_write);
-
- return 0;
}
/* OSPF Hello message read -- RFC2328 Section 10.5. */
@@ -3215,7 +3207,7 @@ static enum ospf_read_return_enum ospf_read_helper(struct ospf *ospf)
}
/* Starting point of packet process function. */
-int ospf_read(struct thread *thread)
+void ospf_read(struct thread *thread)
{
struct ospf *ospf;
int32_t count = 0;
@@ -3232,13 +3224,11 @@ int ospf_read(struct thread *thread)
ret = ospf_read_helper(ospf);
switch (ret) {
case OSPF_READ_ERROR:
- return -1;
+ return;
case OSPF_READ_CONTINUE:
break;
}
}
-
- return 0;
}
/* Make OSPF header. */
@@ -3747,7 +3737,7 @@ static void ospf_poll_send(struct ospf_nbr_nbma *nbr_nbma)
ospf_hello_send_sub(oi, nbr_nbma->addr.s_addr);
}
-int ospf_poll_timer(struct thread *thread)
+void ospf_poll_timer(struct thread *thread)
{
struct ospf_nbr_nbma *nbr_nbma;
@@ -3763,12 +3753,10 @@ int ospf_poll_timer(struct thread *thread)
if (nbr_nbma->v_poll > 0)
OSPF_POLL_TIMER_ON(nbr_nbma->t_poll, ospf_poll_timer,
nbr_nbma->v_poll);
-
- return 0;
}
-int ospf_hello_reply_timer(struct thread *thread)
+void ospf_hello_reply_timer(struct thread *thread)
{
struct ospf_neighbor *nbr;
@@ -3780,8 +3768,6 @@ int ospf_hello_reply_timer(struct thread *thread)
IF_NAME(nbr->oi), &nbr->router_id);
ospf_hello_send_sub(nbr->oi, nbr->address.u.prefix4.s_addr);
-
- return 0;
}
/* Send OSPF Hello. */
@@ -4124,7 +4110,7 @@ static void ospf_ls_upd_queue_send(struct ospf_interface *oi,
}
}
-static int ospf_ls_upd_send_queue_event(struct thread *thread)
+static void ospf_ls_upd_send_queue_event(struct thread *thread)
{
struct ospf_interface *oi = THREAD_ARG(thread);
struct route_node *rn;
@@ -4167,8 +4153,6 @@ static int ospf_ls_upd_send_queue_event(struct thread *thread)
if (IS_DEBUG_OSPF_EVENT)
zlog_debug("ospf_ls_upd_send_queue stop");
-
- return 0;
}
void ospf_ls_upd_send(struct ospf_neighbor *nbr, struct list *update, int flag,
@@ -4272,7 +4256,7 @@ static void ospf_ls_ack_send_list(struct ospf_interface *oi, struct list *ack,
OSPF_ISM_WRITE_ON(oi->ospf);
}
-static int ospf_ls_ack_send_event(struct thread *thread)
+static void ospf_ls_ack_send_event(struct thread *thread)
{
struct ospf_interface *oi = THREAD_ARG(thread);
@@ -4281,8 +4265,6 @@ static int ospf_ls_ack_send_event(struct thread *thread)
while (listcount(oi->ls_ack_direct.ls_ack))
ospf_ls_ack_send_list(oi, oi->ls_ack_direct.ls_ack,
oi->ls_ack_direct.dst);
-
- return 0;
}
void ospf_ls_ack_send(struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
diff --git a/ospfd/ospf_packet.h b/ospfd/ospf_packet.h
index 72b87edaf..cefc9c21b 100644
--- a/ospfd/ospf_packet.h
+++ b/ospfd/ospf_packet.h
@@ -139,7 +139,7 @@ extern struct ospf_packet *ospf_fifo_head(struct ospf_fifo *);
extern void ospf_fifo_flush(struct ospf_fifo *);
extern void ospf_fifo_free(struct ospf_fifo *);
-extern int ospf_read(struct thread *);
+extern void ospf_read(struct thread *thread);
extern void ospf_hello_send(struct ospf_interface *);
extern void ospf_db_desc_send(struct ospf_neighbor *);
extern void ospf_db_desc_resend(struct ospf_neighbor *);
@@ -152,10 +152,10 @@ extern void ospf_ls_ack_send_delayed(struct ospf_interface *);
extern void ospf_ls_retransmit(struct ospf_interface *, struct ospf_lsa *);
extern void ospf_ls_req_event(struct ospf_neighbor *);
-extern int ospf_ls_upd_timer(struct thread *);
-extern int ospf_ls_ack_timer(struct thread *);
-extern int ospf_poll_timer(struct thread *);
-extern int ospf_hello_reply_timer(struct thread *);
+extern void ospf_ls_upd_timer(struct thread *thread);
+extern void ospf_ls_ack_timer(struct thread *thread);
+extern void ospf_poll_timer(struct thread *thread);
+extern void ospf_hello_reply_timer(struct thread *thread);
extern const struct message ospf_packet_type_str[];
extern const size_t ospf_packet_type_str_max;
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 8b4d55984..f76340021 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -1809,7 +1809,7 @@ void ospf_spf_calculate_areas(struct ospf *ospf, struct route_table *new_table,
}
/* Worker for SPF calculation scheduler. */
-static int ospf_spf_calculate_schedule_worker(struct thread *thread)
+static void ospf_spf_calculate_schedule_worker(struct thread *thread)
{
struct ospf *ospf = THREAD_ARG(thread);
struct route_table *new_table, *new_rtrs;
@@ -1929,8 +1929,6 @@ static int ospf_spf_calculate_schedule_worker(struct thread *thread)
}
ospf_clear_spf_reason_flags();
-
- return 0;
}
/*
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c
index 181cc37f4..e4059d05c 100644
--- a/ospfd/ospf_sr.c
+++ b/ospfd/ospf_sr.c
@@ -470,7 +470,7 @@ int ospf_sr_local_block_release_label(mpls_label_t label)
*
* @return 1 on success
*/
-static int sr_start_label_manager(struct thread *start)
+static void sr_start_label_manager(struct thread *start)
{
struct ospf *ospf;
@@ -478,8 +478,6 @@ static int sr_start_label_manager(struct thread *start)
/* re-attempt to start SR & Label Manager connection */
ospf_sr_start(ospf);
-
- return 1;
}
/* Segment Routing starter function */
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 66b7425a8..389d3647d 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -524,7 +524,7 @@ bool ospf_external_default_routemap_apply_walk(struct ospf *ospf,
* Function to originate or flush default after applying
* route-map on all ei.
*/
-static int ospf_external_lsa_default_routemap_timer(struct thread *thread)
+static void ospf_external_lsa_default_routemap_timer(struct thread *thread)
{
struct list *ext_list;
struct ospf *ospf = THREAD_ARG(thread);
@@ -545,7 +545,7 @@ static int ospf_external_lsa_default_routemap_timer(struct thread *thread)
/* Nothing to be done here. */
if (IS_DEBUG_OSPF_DEFAULT_INFO)
zlog_debug("Default originate info not present");
- return 0;
+ return;
}
/* For all the ei apply route-map */
@@ -570,8 +570,6 @@ static int ospf_external_lsa_default_routemap_timer(struct thread *thread)
ospf_external_lsa_refresh(ospf, lsa, default_ei, true, false);
else if (!ret && lsa)
ospf_external_lsa_flush(ospf, DEFAULT_ROUTE, &default_ei->p, 0);
-
- return 1;
}
@@ -1522,7 +1520,7 @@ int ospf_distribute_list_out_unset(struct ospf *ospf, int type,
}
/* distribute-list update timer. */
-static int ospf_distribute_list_update_timer(struct thread *thread)
+static void ospf_distribute_list_update_timer(struct thread *thread)
{
struct route_node *rn;
struct external_info *ei;
@@ -1532,7 +1530,7 @@ static int ospf_distribute_list_update_timer(struct thread *thread)
struct ospf *ospf = THREAD_ARG(thread);
if (ospf == NULL)
- return 0;
+ return;
ospf->t_distribute_update = NULL;
@@ -1639,8 +1637,6 @@ static int ospf_distribute_list_update_timer(struct thread *thread)
}
if (default_refresh)
ospf_external_lsa_refresh_default(ospf);
-
- return 0;
}
/* Update distribute-list and set timer to apply access-list. */
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index b1bba9eb4..221f6e7e4 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -584,13 +584,11 @@ static void ospf_deferred_shutdown_finish(struct ospf *ospf)
}
/* Timer thread for G-R */
-static int ospf_deferred_shutdown_timer(struct thread *t)
+static void ospf_deferred_shutdown_timer(struct thread *t)
{
struct ospf *ospf = THREAD_ARG(t);
ospf_deferred_shutdown_finish(ospf);
-
- return 0;
}
/* Check whether deferred-shutdown must be scheduled, otherwise call