diff options
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/dplane_fpm_nl.c | 90 | ||||
-rw-r--r-- | zebra/interface.c | 6 | ||||
-rw-r--r-- | zebra/irdp.h | 4 | ||||
-rw-r--r-- | zebra/irdp_main.c | 5 | ||||
-rw-r--r-- | zebra/irdp_packet.c | 12 | ||||
-rw-r--r-- | zebra/kernel_netlink.c | 4 | ||||
-rw-r--r-- | zebra/kernel_socket.c | 9 | ||||
-rw-r--r-- | zebra/main.c | 2 | ||||
-rw-r--r-- | zebra/rib.h | 2 | ||||
-rw-r--r-- | zebra/rtadv.c | 10 | ||||
-rw-r--r-- | zebra/zebra_dplane.c | 17 | ||||
-rw-r--r-- | zebra/zebra_evpn_mac.c | 18 | ||||
-rw-r--r-- | zebra/zebra_evpn_mh.c | 8 | ||||
-rw-r--r-- | zebra/zebra_evpn_neigh.c | 16 | ||||
-rw-r--r-- | zebra/zebra_fpm.c | 46 | ||||
-rw-r--r-- | zebra/zebra_gr.c | 5 | ||||
-rw-r--r-- | zebra/zebra_mlag.c | 19 | ||||
-rw-r--r-- | zebra/zebra_mlag_private.c | 22 | ||||
-rw-r--r-- | zebra/zebra_netns_notify.c | 35 | ||||
-rw-r--r-- | zebra/zebra_opaque.c | 6 | ||||
-rw-r--r-- | zebra/zebra_ptm.c | 22 | ||||
-rw-r--r-- | zebra/zebra_ptm.h | 2 | ||||
-rw-r--r-- | zebra/zebra_pw.c | 6 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 12 | ||||
-rw-r--r-- | zebra/zebra_routemap.c | 3 | ||||
-rw-r--r-- | zebra/zserv.c | 27 | ||||
-rw-r--r-- | zebra/zserv.h | 2 |
27 files changed, 160 insertions, 250 deletions
diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index 3b02128c9..ce3c8d4b1 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -176,16 +176,16 @@ enum fpm_nl_events { /* * Prototypes. */ -static int fpm_process_event(struct thread *t); +static void fpm_process_event(struct thread *t); static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx); -static int fpm_lsp_send(struct thread *t); -static int fpm_lsp_reset(struct thread *t); -static int fpm_nhg_send(struct thread *t); -static int fpm_nhg_reset(struct thread *t); -static int fpm_rib_send(struct thread *t); -static int fpm_rib_reset(struct thread *t); -static int fpm_rmac_send(struct thread *t); -static int fpm_rmac_reset(struct thread *t); +static void fpm_lsp_send(struct thread *t); +static void fpm_lsp_reset(struct thread *t); +static void fpm_nhg_send(struct thread *t); +static void fpm_nhg_reset(struct thread *t); +static void fpm_rib_send(struct thread *t); +static void fpm_rib_reset(struct thread *t); +static void fpm_rmac_send(struct thread *t); +static void fpm_rmac_reset(struct thread *t); /* * CLI. @@ -419,7 +419,7 @@ static struct cmd_node fpm_node = { /* * FPM functions. */ -static int fpm_connect(struct thread *t); +static void fpm_connect(struct thread *t); static void fpm_reconnect(struct fpm_nl_ctx *fnc) { @@ -458,7 +458,7 @@ static void fpm_reconnect(struct fpm_nl_ctx *fnc) &fnc->t_connect); } -static int fpm_read(struct thread *t) +static void fpm_read(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); ssize_t rv; @@ -471,7 +471,7 @@ static int fpm_read(struct thread *t) /* Schedule next read. */ thread_add_read(fnc->fthread->master, fpm_read, fnc, fnc->socket, &fnc->t_read); - return 0; + return; } if (rv == 0) { atomic_fetch_add_explicit(&fnc->counters.connection_closes, 1, @@ -481,7 +481,7 @@ static int fpm_read(struct thread *t) zlog_debug("%s: connection closed", __func__); FPM_RECONNECT(fnc); - return 0; + return; } if (rv == -1) { atomic_fetch_add_explicit(&fnc->counters.connection_errors, 1, @@ -489,7 +489,7 @@ static int fpm_read(struct thread *t) zlog_warn("%s: connection failure: %s", __func__, strerror(errno)); FPM_RECONNECT(fnc); - return 0; + return; } stream_reset(fnc->ibuf); @@ -499,11 +499,9 @@ static int fpm_read(struct thread *t) thread_add_read(fnc->fthread->master, fpm_read, fnc, fnc->socket, &fnc->t_read); - - return 0; } -static int fpm_write(struct thread *t) +static void fpm_write(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); socklen_t statuslen; @@ -530,7 +528,7 @@ static int fpm_write(struct thread *t) memory_order_relaxed); FPM_RECONNECT(fnc); - return 0; + return; } fnc->connecting = false; @@ -584,7 +582,7 @@ static int fpm_write(struct thread *t) strerror(errno)); FPM_RECONNECT(fnc); - return 0; + return; } /* Account all bytes sent. */ @@ -603,13 +601,11 @@ static int fpm_write(struct thread *t) stream_pulldown(fnc->obuf); thread_add_write(fnc->fthread->master, fpm_write, fnc, fnc->socket, &fnc->t_write); - return 0; + return; } - - return 0; } -static int fpm_connect(struct thread *t) +static void fpm_connect(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); struct sockaddr_in *sin = (struct sockaddr_in *)&fnc->addr; @@ -624,7 +620,7 @@ static int fpm_connect(struct thread *t) strerror(errno)); thread_add_timer(fnc->fthread->master, fpm_connect, fnc, 3, &fnc->t_connect); - return 0; + return; } set_nonblocking(sock); @@ -650,7 +646,7 @@ static int fpm_connect(struct thread *t) strerror(errno)); thread_add_timer(fnc->fthread->master, fpm_connect, fnc, 3, &fnc->t_connect); - return 0; + return; } fnc->connecting = (errno == EINPROGRESS); @@ -670,8 +666,6 @@ static int fpm_connect(struct thread *t) if (!fnc->connecting) thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0, &fnc->t_lspreset); - - return 0; } /** @@ -893,7 +887,7 @@ static int fpm_lsp_send_cb(struct hash_bucket *bucket, void *arg) return HASHWALK_CONTINUE; } -static int fpm_lsp_send(struct thread *t) +static void fpm_lsp_send(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); struct zebra_vrf *zvrf = vrf_info_lookup(VRF_DEFAULT); @@ -918,8 +912,6 @@ static int fpm_lsp_send(struct thread *t) thread_add_timer(zrouter.master, fpm_lsp_send, fnc, 0, &fnc->t_lspwalk); } - - return 0; } /* @@ -955,7 +947,7 @@ static int fpm_nhg_send_cb(struct hash_bucket *bucket, void *arg) return HASHWALK_CONTINUE; } -static int fpm_nhg_send(struct thread *t) +static void fpm_nhg_send(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); struct fpm_nhg_arg fna; @@ -979,14 +971,12 @@ static int fpm_nhg_send(struct thread *t) } else /* Otherwise reschedule next hop group again. */ thread_add_timer(zrouter.master, fpm_nhg_send, fnc, 0, &fnc->t_nhgwalk); - - return 0; } /** * Send all RIB installed routes to the connected data plane. */ -static int fpm_rib_send(struct thread *t) +static void fpm_rib_send(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); rib_dest_t *dest; @@ -1020,7 +1010,7 @@ static int fpm_rib_send(struct thread *t) thread_add_timer(zrouter.master, fpm_rib_send, fnc, 1, &fnc->t_ribwalk); - return 0; + return; } /* Mark as sent. */ @@ -1037,8 +1027,6 @@ static int fpm_rib_send(struct thread *t) /* Schedule next event: RMAC reset. */ thread_add_event(zrouter.master, fpm_rmac_reset, fnc, 0, &fnc->t_rmacreset); - - return 0; } /* @@ -1092,7 +1080,7 @@ static void fpm_enqueue_l3vni_table(struct hash_bucket *bucket, void *arg) hash_iterate(zl3vni->rmac_table, fpm_enqueue_rmac_table, zl3vni); } -static int fpm_rmac_send(struct thread *t) +static void fpm_rmac_send(struct thread *t) { struct fpm_rmac_arg fra; @@ -1105,8 +1093,6 @@ static int fpm_rmac_send(struct thread *t) /* RMAC walk completed. */ if (fra.complete) WALK_FINISH(fra.fnc, FNE_RMAC_FINISHED); - - return 0; } /* @@ -1120,7 +1106,7 @@ static void fpm_nhg_reset_cb(struct hash_bucket *bucket, void *arg) UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_FPM); } -static int fpm_nhg_reset(struct thread *t) +static void fpm_nhg_reset(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); @@ -1128,8 +1114,6 @@ static int fpm_nhg_reset(struct thread *t) /* Schedule next step: send next hop groups. */ thread_add_event(zrouter.master, fpm_nhg_send, fnc, 0, &fnc->t_nhgwalk); - - return 0; } /* @@ -1142,7 +1126,7 @@ static void fpm_lsp_reset_cb(struct hash_bucket *bucket, void *arg) UNSET_FLAG(lsp->flags, LSP_FLAG_FPM); } -static int fpm_lsp_reset(struct thread *t) +static void fpm_lsp_reset(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); struct zebra_vrf *zvrf = vrf_info_lookup(VRF_DEFAULT); @@ -1151,14 +1135,12 @@ static int fpm_lsp_reset(struct thread *t) /* Schedule next step: send LSPs */ thread_add_event(zrouter.master, fpm_lsp_send, fnc, 0, &fnc->t_lspwalk); - - return 0; } /** * Resets the RIB FPM flags so we send all routes again. */ -static int fpm_rib_reset(struct thread *t) +static void fpm_rib_reset(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); rib_dest_t *dest; @@ -1180,8 +1162,6 @@ static int fpm_rib_reset(struct thread *t) /* Schedule next step: send RIB routes. */ thread_add_event(zrouter.master, fpm_rib_send, fnc, 0, &fnc->t_ribwalk); - - return 0; } /* @@ -1201,7 +1181,7 @@ static void fpm_unset_l3vni_table(struct hash_bucket *bucket, void *arg) hash_iterate(zl3vni->rmac_table, fpm_unset_rmac_table, zl3vni); } -static int fpm_rmac_reset(struct thread *t) +static void fpm_rmac_reset(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); @@ -1210,11 +1190,9 @@ static int fpm_rmac_reset(struct thread *t) /* Schedule next event: send RMAC entries. */ thread_add_event(zrouter.master, fpm_rmac_send, fnc, 0, &fnc->t_rmacwalk); - - return 0; } -static int fpm_process_queue(struct thread *t) +static void fpm_process_queue(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); struct zebra_dplane_ctx *ctx; @@ -1269,14 +1247,12 @@ static int fpm_process_queue(struct thread *t) */ if (dplane_provider_out_ctx_queue_len(fnc->prov) > 0) dplane_provider_work_ready(); - - return 0; } /** * Handles external (e.g. CLI, data plane or others) events. */ -static int fpm_process_event(struct thread *t) +static void fpm_process_event(struct thread *t) { struct fpm_nl_ctx *fnc = THREAD_ARG(t); int event = THREAD_VAL(t); @@ -1338,8 +1314,6 @@ static int fpm_process_event(struct thread *t) zlog_debug("%s: unhandled event %d", __func__, event); break; } - - return 0; } /* diff --git a/zebra/interface.c b/zebra/interface.c index 2e13cfd55..5d1080fd7 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -64,7 +64,7 @@ DEFINE_HOOK(zebra_if_config_wr, (struct vty * vty, struct interface *ifp), static void if_down_del_nbr_connected(struct interface *ifp); -static int if_zebra_speed_update(struct thread *thread) +static void if_zebra_speed_update(struct thread *thread) { struct interface *ifp = THREAD_ARG(thread); struct zebra_if *zif = ifp->info; @@ -81,7 +81,7 @@ static int if_zebra_speed_update(struct thread *thread) * note that loopback & virtual interfaces can return 0 as speed */ if (error < 0) - return 1; + return; if (new_speed != ifp->speed) { zlog_info("%s: %s old speed: %u new speed: %u", __func__, @@ -96,8 +96,6 @@ static int if_zebra_speed_update(struct thread *thread) &zif->speed_update); thread_ignore_late_timer(zif->speed_update); } - - return 1; } static void zebra_if_node_destroy(route_table_delegate_t *delegate, diff --git a/zebra/irdp.h b/zebra/irdp.h index c1ea34f3a..19f549cc5 100644 --- a/zebra/irdp.h +++ b/zebra/irdp.h @@ -144,10 +144,10 @@ struct Adv { extern void irdp_if_init(void); extern int irdp_sock_init(void); extern int irdp_config_write(struct vty *, struct interface *); -extern int irdp_send_thread(struct thread *t_advert); +extern void irdp_send_thread(struct thread *t_advert); extern void irdp_advert_off(struct interface *ifp); extern void process_solicit(struct interface *ifp); -extern int irdp_read_raw(struct thread *r); +extern void irdp_read_raw(struct thread *r); extern void send_packet(struct interface *ifp, struct stream *s, uint32_t dst, struct prefix *p, uint32_t ttl); diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c index f141b7271..43478c98f 100644 --- a/zebra/irdp_main.c +++ b/zebra/irdp_main.c @@ -205,7 +205,7 @@ static void irdp_advertisement(struct interface *ifp, struct prefix *p) stream_free(s); } -int irdp_send_thread(struct thread *t_advert) +void irdp_send_thread(struct thread *t_advert) { uint32_t timer, tmp; struct interface *ifp = THREAD_ARG(t_advert); @@ -216,7 +216,7 @@ int irdp_send_thread(struct thread *t_advert) struct connected *ifc; if (!irdp) - return 0; + return; irdp->flags &= ~IF_SOLICIT; @@ -246,7 +246,6 @@ int irdp_send_thread(struct thread *t_advert) irdp->t_advertise = NULL; thread_add_timer(zrouter.master, irdp_send_thread, ifp, timer, &irdp->t_advertise); - return 0; } void irdp_advert_off(struct interface *ifp) diff --git a/zebra/irdp_packet.c b/zebra/irdp_packet.c index 5601b13a9..c27d97ba7 100644 --- a/zebra/irdp_packet.c +++ b/zebra/irdp_packet.c @@ -224,7 +224,7 @@ static int irdp_recvmsg(int sock, uint8_t *buf, int size, int *ifindex) return ret; } -int irdp_read_raw(struct thread *r) +void irdp_read_raw(struct thread *r) { struct interface *ifp; struct zebra_if *zi; @@ -243,22 +243,22 @@ int irdp_read_raw(struct thread *r) ifp = if_lookup_by_index(ifindex, VRF_DEFAULT); if (!ifp) - return ret; + return; zi = ifp->info; if (!zi) - return ret; + return; irdp = zi->irdp; if (!irdp) - return ret; + return; if (!(irdp->flags & IF_ACTIVE)) { if (irdp->flags & IF_DEBUG_MISC) zlog_debug("IRDP: RX ICMP for disabled interface %s", ifp->name); - return 0; + return; } if (irdp->flags & IF_DEBUG_PACKET) { @@ -269,8 +269,6 @@ int irdp_read_raw(struct thread *r) } parse_irdp_packet(buf, ret, ifp); - - return ret; } void send_packet(struct interface *ifp, struct stream *s, uint32_t dst, diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 84c15a2a9..23e7098d0 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -418,7 +418,7 @@ static int dplane_netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id, return 0; } -static int kernel_read(struct thread *thread) +static void kernel_read(struct thread *thread) { struct zebra_ns *zns = (struct zebra_ns *)THREAD_ARG(thread); struct zebra_dplane_info dp_info; @@ -431,8 +431,6 @@ static int kernel_read(struct thread *thread) thread_add_read(zrouter.master, kernel_read, zns, zns->netlink.sock, &zns->t_netlink); - - return 0; } /* diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index b9228072e..53b7a21d3 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -1292,7 +1292,7 @@ static void rtmsg_debug(struct rt_msghdr *rtm) #endif /* RTAX_MAX */ /* Kernel routing table and interface updates via routing socket. */ -static int kernel_read(struct thread *thread) +static void kernel_read(struct thread *thread) { int sock; int nbytes; @@ -1356,11 +1356,11 @@ static int kernel_read(struct thread *thread) if (errno != EAGAIN && errno != EWOULDBLOCK) flog_err_sys(EC_LIB_SOCKET, "routing socket error: %s", safe_strerror(errno)); - return 0; + return; } if (nbytes == 0) - return 0; + return; thread_add_read(zrouter.master, kernel_read, NULL, sock, NULL); @@ -1377,7 +1377,7 @@ static int kernel_read(struct thread *thread) zlog_debug( "kernel_read: rtm->rtm_msglen %d, nbytes %d, type %d", rtm->rtm_msglen, nbytes, rtm->rtm_type); - return -1; + return; } switch (rtm->rtm_type) { @@ -1403,7 +1403,6 @@ static int kernel_read(struct thread *thread) zlog_debug("Unprocessed RTM_type: %d", rtm->rtm_type); break; } - return 0; } /* Make routing socket. */ diff --git a/zebra/main.c b/zebra/main.c index 079751af0..9deafb532 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -213,7 +213,7 @@ static void sigint(void) * Final shutdown step for the zebra main thread. This is run after all * async update processing has completed. */ -int zebra_finalize(struct thread *dummy) +void zebra_finalize(struct thread *dummy) { zlog_info("Zebra final shutdown"); diff --git a/zebra/rib.h b/zebra/rib.h index ae1fce727..c6f3528ce 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -432,7 +432,7 @@ extern struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p, extern void rib_update(enum rib_update_event event); extern void rib_update_table(struct route_table *table, enum rib_update_event event, int rtype); -extern int rib_sweep_route(struct thread *t); +extern void rib_sweep_route(struct thread *t); extern void rib_sweep_table(struct route_table *table); extern void rib_close_table(struct route_table *table); extern void rib_init(void); diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 3bbee83d7..2ce507294 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -471,7 +471,7 @@ no_more_opts: zif->ra_sent++; } -static int rtadv_timer(struct thread *thread) +static void rtadv_timer(struct thread *thread) { struct zebra_vrf *zvrf = THREAD_ARG(thread); struct vrf *vrf; @@ -534,8 +534,6 @@ static int rtadv_timer(struct thread *thread) } } } - - return 0; } static void rtadv_process_solicit(struct interface *ifp) @@ -774,7 +772,7 @@ static void rtadv_process_packet(uint8_t *buf, unsigned int len, return; } -static int rtadv_read(struct thread *thread) +static void rtadv_read(struct thread *thread) { int sock; int len; @@ -797,12 +795,10 @@ static int rtadv_read(struct thread *thread) flog_err_sys(EC_LIB_SOCKET, "RA/RS recv failed, socket %u error %s", sock, safe_strerror(errno)); - return len; + return; } rtadv_process_packet(buf, (unsigned)len, ifindex, hoplimit, &from, zvrf); - - return 0; } static int rtadv_make_socket(ns_id_t ns_id) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 9f9270db9..1967345d2 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -539,7 +539,7 @@ DECLARE_DLIST(zns_info_list, struct dplane_zns_info, link); #define DPLANE_PROV_UNLOCK(p) pthread_mutex_unlock(&((p)->dp_mutex)) /* Prototypes */ -static int dplane_thread_loop(struct thread *event); +static void dplane_thread_loop(struct thread *event); static void dplane_info_from_zns(struct zebra_dplane_info *ns_info, struct zebra_ns *zns); static enum zebra_dplane_result lsp_update_internal(struct zebra_lsp *lsp, @@ -4864,7 +4864,7 @@ static void dplane_info_from_zns(struct zebra_dplane_info *ns_info, * Callback when an OS (netlink) incoming event read is ready. This runs * in the dplane pthread. */ -static int dplane_incoming_read(struct thread *event) +static void dplane_incoming_read(struct thread *event) { struct dplane_zns_info *zi = THREAD_ARG(event); @@ -4873,8 +4873,6 @@ static int dplane_incoming_read(struct thread *event) /* Re-start read task */ thread_add_read(zdplane_info.dg_master, dplane_incoming_read, zi, zi->info.sock, &zi->t_read); - - return 0; } #endif /* HAVE_NETLINK */ @@ -5595,7 +5593,7 @@ done: * final zebra shutdown. * This runs in the dplane pthread context. */ -static int dplane_check_shutdown_status(struct thread *event) +static void dplane_check_shutdown_status(struct thread *event) { struct dplane_zns_info *zi; @@ -5627,8 +5625,6 @@ static int dplane_check_shutdown_status(struct thread *event) */ thread_add_event(zrouter.master, zebra_finalize, NULL, 0, NULL); } - - return 0; } /* @@ -5662,7 +5658,7 @@ void zebra_dplane_finish(void) * pthread can look for other pending work - such as i/o work on behalf of * providers. */ -static int dplane_thread_loop(struct thread *event) +static void dplane_thread_loop(struct thread *event) { struct dplane_ctx_q work_list; struct dplane_ctx_q error_list; @@ -5682,7 +5678,7 @@ static int dplane_thread_loop(struct thread *event) /* Check for zebra shutdown */ if (!zdplane_info.dg_run) - goto done; + return; /* Dequeue some incoming work from zebra (if any) onto the temporary * working list. @@ -5848,9 +5844,6 @@ static int dplane_thread_loop(struct thread *event) (zdplane_info.dg_results_cb)(&work_list); TAILQ_INIT(&work_list); - -done: - return 0; } /* diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index d3791f3e5..e38766bc6 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -383,7 +383,7 @@ static char *zebra_evpn_zebra_mac_flag_dump(struct zebra_mac *mac, char *buf, return buf; } -static int zebra_evpn_dad_mac_auto_recovery_exp(struct thread *t) +static void zebra_evpn_dad_mac_auto_recovery_exp(struct thread *t) { struct zebra_vrf *zvrf = NULL; struct zebra_mac *mac = NULL; @@ -396,15 +396,15 @@ static int zebra_evpn_dad_mac_auto_recovery_exp(struct thread *t) /* since this is asynchronous we need sanity checks*/ zvrf = vrf_info_lookup(mac->zevpn->vrf_id); if (!zvrf) - return 0; + return; zevpn = zebra_evpn_lookup(mac->zevpn->vni); if (!zevpn) - return 0; + return; mac = zebra_evpn_mac_lookup(zevpn, &mac->macaddr); if (!mac) - return 0; + return; if (IS_ZEBRA_DEBUG_VXLAN) { char mac_buf[MAC_BUF_SIZE]; @@ -445,7 +445,7 @@ static int zebra_evpn_dad_mac_auto_recovery_exp(struct thread *t) if (zebra_evpn_mac_send_add_to_client(zevpn->vni, &mac->macaddr, mac->flags, mac->loc_seq, mac->es)) - return -1; + return; /* Process all neighbors associated with this MAC. */ zebra_evpn_process_neigh_on_local_mac_change(zevpn, mac, 0, @@ -457,8 +457,6 @@ static int zebra_evpn_dad_mac_auto_recovery_exp(struct thread *t) /* Install the entry. */ zebra_evpn_rem_mac_install(zevpn, mac, false /* was_static */); } - - return 0; } static void zebra_evpn_dup_addr_detect_for_mac(struct zebra_vrf *zvrf, @@ -1470,7 +1468,7 @@ void zebra_evpn_mac_send_add_del_to_client(struct zebra_mac *mac, * external neighmgr daemon to probe existing hosts to independently * establish their presence on the ES. */ -static int zebra_evpn_mac_hold_exp_cb(struct thread *t) +static void zebra_evpn_mac_hold_exp_cb(struct thread *t) { struct zebra_mac *mac; bool old_bgp_ready; @@ -1483,7 +1481,7 @@ static int zebra_evpn_mac_hold_exp_cb(struct thread *t) * flag */ if (!CHECK_FLAG(mac->flags, ZEBRA_MAC_ES_PEER_ACTIVE)) - return 0; + return; old_bgp_ready = zebra_evpn_mac_is_ready_for_bgp(mac->flags); old_static = zebra_evpn_mac_is_static(mac); @@ -1514,8 +1512,6 @@ static int zebra_evpn_mac_hold_exp_cb(struct thread *t) if (old_bgp_ready != new_bgp_ready) zebra_evpn_mac_send_add_del_to_client(mac, old_bgp_ready, new_bgp_ready); - - return 0; } static inline void zebra_evpn_mac_start_hold_timer(struct zebra_mac *mac) diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index af4629e41..50eecd31d 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -2131,7 +2131,7 @@ static void zebra_evpn_mh_advertise_svi_mac(void) zebra_evpn_acc_vl_adv_svi_mac_all(); } -static int zebra_evpn_es_df_delay_exp_cb(struct thread *t) +static void zebra_evpn_es_df_delay_exp_cb(struct thread *t) { struct zebra_evpn_es *es; @@ -2141,8 +2141,6 @@ static int zebra_evpn_es_df_delay_exp_cb(struct thread *t) zlog_debug("es %s df-delay expired", es->esi_str); zebra_evpn_es_run_df_election(es, __func__); - - return 0; } /* currently there is no global config to turn on MH instead we use @@ -3860,15 +3858,13 @@ void zebra_evpn_mh_uplink_oper_update(struct zebra_if *zif) new_protodown); } -static int zebra_evpn_mh_startup_delay_exp_cb(struct thread *t) +static void zebra_evpn_mh_startup_delay_exp_cb(struct thread *t) { if (IS_ZEBRA_DEBUG_EVPN_MH_ES) zlog_debug("startup-delay expired"); zebra_evpn_mh_update_protodown(ZEBRA_PROTODOWN_EVPN_STARTUP_DELAY, false /* set */); - - return 0; } static void zebra_evpn_mh_startup_delay_timer_start(const char *rc) diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c index c3218d0f9..f557e6638 100644 --- a/zebra/zebra_evpn_neigh.c +++ b/zebra/zebra_evpn_neigh.c @@ -411,7 +411,7 @@ void zebra_evpn_sync_neigh_static_chg(struct zebra_neigh *n, bool old_n_static, * external neighmgr daemon to probe existing hosts to independently * establish their presence on the ES. */ -static int zebra_evpn_neigh_hold_exp_cb(struct thread *t) +static void zebra_evpn_neigh_hold_exp_cb(struct thread *t) { struct zebra_neigh *n; bool old_bgp_ready; @@ -424,7 +424,7 @@ static int zebra_evpn_neigh_hold_exp_cb(struct thread *t) * flag */ if (!CHECK_FLAG(n->flags, ZEBRA_NEIGH_ES_PEER_ACTIVE)) - return 0; + return; old_bgp_ready = zebra_evpn_neigh_is_ready_for_bgp(n); old_n_static = zebra_evpn_neigh_is_static(n); @@ -448,8 +448,6 @@ static int zebra_evpn_neigh_hold_exp_cb(struct thread *t) if (old_bgp_ready != new_bgp_ready) zebra_evpn_neigh_send_add_del_to_client(n, old_bgp_ready, new_bgp_ready); - - return 0; } static inline void zebra_evpn_neigh_start_hold_timer(struct zebra_neigh *n) @@ -1092,7 +1090,7 @@ static int zebra_evpn_ip_inherit_dad_from_mac(struct zebra_vrf *zvrf, return 0; } -static int zebra_evpn_dad_ip_auto_recovery_exp(struct thread *t) +static void zebra_evpn_dad_ip_auto_recovery_exp(struct thread *t) { struct zebra_vrf *zvrf = NULL; struct zebra_neigh *nbr = NULL; @@ -1103,15 +1101,15 @@ static int zebra_evpn_dad_ip_auto_recovery_exp(struct thread *t) /* since this is asynchronous we need sanity checks*/ zvrf = vrf_info_lookup(nbr->zevpn->vrf_id); if (!zvrf) - return 0; + return; zevpn = zebra_evpn_lookup(nbr->zevpn->vni); if (!zevpn) - return 0; + return; nbr = zebra_evpn_neigh_lookup(zevpn, &nbr->ip); if (!nbr) - return 0; + return; if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug( @@ -1135,8 +1133,6 @@ static int zebra_evpn_dad_ip_auto_recovery_exp(struct thread *t) } else if (!!CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_REMOTE)) { zebra_evpn_rem_neigh_install(zevpn, nbr, false /*was_static*/); } - - return 0; } static void zebra_evpn_dup_addr_detect_for_neigh( diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 43958fdfd..6766c752a 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -284,8 +284,8 @@ static struct zfpm_glob *zfpm_g = &zfpm_glob_space; static int zfpm_trigger_update(struct route_node *rn, const char *reason); -static int zfpm_read_cb(struct thread *thread); -static int zfpm_write_cb(struct thread *thread); +static void zfpm_read_cb(struct thread *thread); +static void zfpm_write_cb(struct thread *thread); static void zfpm_set_state(enum zfpm_state state, const char *reason); static void zfpm_start_connect_timer(const char *reason); @@ -518,7 +518,7 @@ static inline void zfpm_connect_off(void) * Callback for actions to be taken when the connection to the FPM * comes up. */ -static int zfpm_conn_up_thread_cb(struct thread *thread) +static void zfpm_conn_up_thread_cb(struct thread *thread) { struct route_node *rnode; struct zfpm_rnodes_iter *iter; @@ -559,14 +559,13 @@ static int zfpm_conn_up_thread_cb(struct thread *thread) zfpm_rnodes_iter_pause(iter); thread_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb, NULL, 0, &zfpm_g->t_conn_up); - return 0; + return; } zfpm_g->stats.t_conn_up_finishes++; done: zfpm_rnodes_iter_cleanup(iter); - return 0; } /* @@ -635,7 +634,7 @@ static void zfpm_connect_check(void) * Callback that is invoked to clean up state after the TCP connection * to the FPM goes down. */ -static int zfpm_conn_down_thread_cb(struct thread *thread) +static void zfpm_conn_down_thread_cb(struct thread *thread) { struct route_node *rnode; struct zfpm_rnodes_iter *iter; @@ -686,7 +685,7 @@ static int zfpm_conn_down_thread_cb(struct thread *thread) zfpm_g->t_conn_down = NULL; thread_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb, NULL, 0, &zfpm_g->t_conn_down); - return 0; + return; } zfpm_g->stats.t_conn_down_finishes++; @@ -696,7 +695,6 @@ static int zfpm_conn_down_thread_cb(struct thread *thread) * Start the process of connecting to the FPM again. */ zfpm_start_connect_timer("cleanup complete"); - return 0; } /* @@ -740,7 +738,7 @@ static void zfpm_connection_down(const char *detail) /* * zfpm_read_cb */ -static int zfpm_read_cb(struct thread *thread) +static void zfpm_read_cb(struct thread *thread) { size_t already; struct stream *ibuf; @@ -754,7 +752,7 @@ static int zfpm_read_cb(struct thread *thread) */ if (zfpm_g->state == ZFPM_STATE_CONNECTING) { zfpm_connect_check(); - return 0; + return; } assert(zfpm_g->state == ZFPM_STATE_ESTABLISHED); @@ -778,7 +776,7 @@ static int zfpm_read_cb(struct thread *thread) zfpm_connection_down(buffer); } else zfpm_connection_down("closed socket in read"); - return 0; + return; } if (nbyte != (ssize_t)(FPM_MSG_HDR_LEN - already)) @@ -793,7 +791,7 @@ static int zfpm_read_cb(struct thread *thread) if (!fpm_msg_hdr_ok(hdr)) { zfpm_connection_down("invalid message header"); - return 0; + return; } msg_len = fpm_msg_len(hdr); @@ -816,7 +814,7 @@ static int zfpm_read_cb(struct thread *thread) zfpm_connection_down(buffer); } else zfpm_connection_down("failed to read message"); - return 0; + return; } if (nbyte != (ssize_t)(msg_len - already)) @@ -830,7 +828,6 @@ static int zfpm_read_cb(struct thread *thread) done: zfpm_read_on(); - return 0; } static bool zfpm_updates_pending(void) @@ -1171,7 +1168,7 @@ static void zfpm_build_updates(void) /* * zfpm_write_cb */ -static int zfpm_write_cb(struct thread *thread) +static void zfpm_write_cb(struct thread *thread) { struct stream *s; int num_writes; @@ -1183,7 +1180,7 @@ static int zfpm_write_cb(struct thread *thread) */ if (zfpm_g->state == ZFPM_STATE_CONNECTING) { zfpm_connect_check(); - return 0; + return; } assert(zfpm_g->state == ZFPM_STATE_ESTABLISHED); @@ -1217,7 +1214,7 @@ static int zfpm_write_cb(struct thread *thread) break; zfpm_connection_down("failed to write to socket"); - return 0; + return; } if (bytes_written != bytes_to_write) { @@ -1248,14 +1245,12 @@ static int zfpm_write_cb(struct thread *thread) if (zfpm_writes_pending()) zfpm_write_on(); - - return 0; } /* * zfpm_connect_cb */ -static int zfpm_connect_cb(struct thread *t) +static void zfpm_connect_cb(struct thread *t) { int sock, ret; struct sockaddr_in serv; @@ -1267,7 +1262,7 @@ static int zfpm_connect_cb(struct thread *t) zlog_err("Failed to create socket for connect(): %s", strerror(errno)); zfpm_g->stats.connect_no_sock++; - return 0; + return; } set_nonblocking(sock); @@ -1295,7 +1290,7 @@ static int zfpm_connect_cb(struct thread *t) if (ret >= 0) { zfpm_g->sock = sock; zfpm_connection_up("connect succeeded"); - return 1; + return; } if (errno == EINPROGRESS) { @@ -1304,7 +1299,7 @@ static int zfpm_connect_cb(struct thread *t) zfpm_write_on(); zfpm_set_state(ZFPM_STATE_CONNECTING, "async connect in progress"); - return 0; + return; } zlog_info("can't connect to FPM %d: %s", sock, safe_strerror(errno)); @@ -1314,7 +1309,6 @@ static int zfpm_connect_cb(struct thread *t) * Restart timer for retrying connection. */ zfpm_start_connect_timer("connect() failed"); - return 0; } /* @@ -1663,7 +1657,7 @@ static void zfpm_iterate_rmac_table(struct hash_bucket *bucket, void *args) /* * struct zfpm_statsimer_cb */ -static int zfpm_stats_timer_cb(struct thread *t) +static void zfpm_stats_timer_cb(struct thread *t) { zfpm_g->t_stats = NULL; @@ -1685,8 +1679,6 @@ static int zfpm_stats_timer_cb(struct thread *t) zfpm_stats_reset(&zfpm_g->stats); zfpm_start_stats_timer(); - - return 0; } /* diff --git a/zebra/zebra_gr.c b/zebra/zebra_gr.c index b153ac1d8..56d0df569 100644 --- a/zebra/zebra_gr.c +++ b/zebra/zebra_gr.c @@ -51,7 +51,7 @@ * Forward declaration. */ static struct zserv *zebra_gr_find_stale_client(struct zserv *client); -static int32_t zebra_gr_route_stale_delete_timer_expiry(struct thread *thread); +static void zebra_gr_route_stale_delete_timer_expiry(struct thread *thread); static int32_t zebra_gr_delete_stale_routes(struct client_gr_info *info); static void zebra_gr_process_client_stale_routes(struct zserv *client, vrf_id_t vrf_id); @@ -444,7 +444,7 @@ void zread_client_capabilities(ZAPI_HANDLER_ARGS) * Delete all the stale routes that have not been refreshed * post restart. */ -static int32_t zebra_gr_route_stale_delete_timer_expiry(struct thread *thread) +static void zebra_gr_route_stale_delete_timer_expiry(struct thread *thread) { struct client_gr_info *info; int32_t cnt = 0; @@ -478,7 +478,6 @@ static int32_t zebra_gr_route_stale_delete_timer_expiry(struct thread *thread) info->current_afi = 0; zebra_gr_delete_stale_client(info); } - return 0; } diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c index 40a2c94e2..2042f9403 100644 --- a/zebra/zebra_mlag.c +++ b/zebra/zebra_mlag.c @@ -52,8 +52,8 @@ uint8_t mlag_rd_buffer[ZEBRA_MLAG_BUF_LIMIT]; static bool test_mlag_in_progress; static int zebra_mlag_signal_write_thread(void); -static int zebra_mlag_terminate_pthread(struct thread *event); -static int zebra_mlag_post_data_from_main_thread(struct thread *thread); +static void zebra_mlag_terminate_pthread(struct thread *event); +static void zebra_mlag_post_data_from_main_thread(struct thread *thread); static void zebra_mlag_publish_process_state(struct zserv *client, zebra_message_types_t msg_type); @@ -148,7 +148,7 @@ void zebra_mlag_process_mlag_data(uint8_t *data, uint32_t len) * This thread reads the clients data from the Global queue and encodes with * protobuf and pass on to the MLAG socket. */ -static int zebra_mlag_client_msg_handler(struct thread *event) +static void zebra_mlag_client_msg_handler(struct thread *event) { struct stream *s; uint32_t wr_count = 0; @@ -209,7 +209,6 @@ static int zebra_mlag_client_msg_handler(struct thread *event) */ if (wr_count >= ZEBRA_MLAG_POST_LIMIT) zebra_mlag_signal_write_thread(); - return 0; } /* @@ -309,7 +308,7 @@ static void zebra_mlag_publish_process_state(struct zserv *client, * main thread, because for that access was needed for clients list. * so instead of forcing the locks, messages will be posted from main thread. */ -static int zebra_mlag_post_data_from_main_thread(struct thread *thread) +static void zebra_mlag_post_data_from_main_thread(struct thread *thread) { struct stream *s = THREAD_ARG(thread); struct stream *zebra_s = NULL; @@ -319,7 +318,7 @@ static int zebra_mlag_post_data_from_main_thread(struct thread *thread) uint32_t msg_len = 0; if (!s) - return -1; + return; STREAM_GETL(s, msg_type); if (IS_ZEBRA_DEBUG_MLAG) @@ -356,12 +355,11 @@ static int zebra_mlag_post_data_from_main_thread(struct thread *thread) } stream_free(s); - return 0; + return; stream_failure: stream_free(s); if (zebra_s) stream_free(zebra_s); - return 0; } /* @@ -394,7 +392,7 @@ static void zebra_mlag_spawn_pthread(void) * all clients are un-registered for MLAG Updates, terminate the * MLAG write thread */ -static int zebra_mlag_terminate_pthread(struct thread *event) +static void zebra_mlag_terminate_pthread(struct thread *event) { if (IS_ZEBRA_DEBUG_MLAG) zlog_debug("Zebra MLAG write thread terminate called"); @@ -403,7 +401,7 @@ static int zebra_mlag_terminate_pthread(struct thread *event) if (IS_ZEBRA_DEBUG_MLAG) zlog_debug( "Zebra MLAG: still some clients are interested"); - return 0; + return; } frr_pthread_stop(zrouter.mlag_info.zebra_pth_mlag, NULL); @@ -419,7 +417,6 @@ static int zebra_mlag_terminate_pthread(struct thread *event) * Send Notification to clean private data */ hook_call(zebra_mlag_private_cleanup_data); - return 0; } /* diff --git a/zebra/zebra_mlag_private.c b/zebra/zebra_mlag_private.c index b1bba831d..50a290b9e 100644 --- a/zebra/zebra_mlag_private.c +++ b/zebra/zebra_mlag_private.c @@ -48,8 +48,8 @@ static struct thread_master *zmlag_master; static int mlag_socket; -static int zebra_mlag_connect(struct thread *thread); -static int zebra_mlag_read(struct thread *thread); +static void zebra_mlag_connect(struct thread *thread); +static void zebra_mlag_read(struct thread *thread); /* * Write the data to MLAGD @@ -72,7 +72,7 @@ static void zebra_mlag_sched_read(void) &zrouter.mlag_info.t_read); } -static int zebra_mlag_read(struct thread *thread) +static void zebra_mlag_read(struct thread *thread) { static uint32_t mlag_rd_buf_offset; uint32_t *msglen; @@ -98,13 +98,13 @@ static int zebra_mlag_read(struct thread *thread) mlag_socket); close(mlag_socket); zebra_mlag_handle_process_state(MLAG_DOWN); - return -1; + return; } mlag_rd_buf_offset += data_len; if (data_len != (ssize_t)(ZEBRA_MLAG_LEN_SIZE - curr_len)) { /* Try again later */ zebra_mlag_sched_read(); - return 0; + return; } curr_len = ZEBRA_MLAG_LEN_SIZE; } @@ -136,13 +136,13 @@ static int zebra_mlag_read(struct thread *thread) mlag_socket); close(mlag_socket); zebra_mlag_handle_process_state(MLAG_DOWN); - return -1; + return; } mlag_rd_buf_offset += data_len; if (data_len != (ssize_t)(tot_len - curr_len)) { /* Try again later */ zebra_mlag_sched_read(); - return 0; + return; } } @@ -162,10 +162,9 @@ static int zebra_mlag_read(struct thread *thread) zebra_mlag_reset_read_buffer(); mlag_rd_buf_offset = 0; zebra_mlag_sched_read(); - return 0; } -static int zebra_mlag_connect(struct thread *thread) +static void zebra_mlag_connect(struct thread *thread) { struct sockaddr_un svr = {0}; @@ -178,7 +177,7 @@ static int zebra_mlag_connect(struct thread *thread) mlag_socket = socket(svr.sun_family, SOCK_STREAM, 0); if (mlag_socket < 0) - return -1; + return; if (connect(mlag_socket, (struct sockaddr *)&svr, sizeof(svr)) == -1) { if (IS_ZEBRA_DEBUG_MLAG) @@ -189,7 +188,7 @@ static int zebra_mlag_connect(struct thread *thread) zrouter.mlag_info.timer_running = true; thread_add_timer(zmlag_master, zebra_mlag_connect, NULL, 10, &zrouter.mlag_info.t_read); - return 0; + return; } set_nonblocking(mlag_socket); @@ -204,7 +203,6 @@ static int zebra_mlag_connect(struct thread *thread) * Connection is established with MLAGD, post to clients */ zebra_mlag_handle_process_state(MLAG_UP); - return 0; } /* diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 8cc7724f0..7cb190689 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -61,11 +61,11 @@ struct zebra_netns_info { unsigned int retries; }; -static int zebra_ns_ready_read(struct thread *t); +static void zebra_ns_ready_read(struct thread *t); static void zebra_ns_notify_create_context_from_entry_name(const char *name); static int zebra_ns_continue_read(struct zebra_netns_info *zns_info, int stop_retry); -static int zebra_ns_notify_read(struct thread *t); +static void zebra_ns_notify_read(struct thread *t); static struct vrf *vrf_handler_create(struct vty *vty, const char *vrfname) { @@ -231,17 +231,17 @@ static bool zebra_ns_notify_is_default_netns(const char *name) return false; } -static int zebra_ns_ready_read(struct thread *t) +static void zebra_ns_ready_read(struct thread *t) { struct zebra_netns_info *zns_info = THREAD_ARG(t); const char *netnspath; int err, stop_retry = 0; if (!zns_info) - return 0; + return; if (!zns_info->netnspath) { XFREE(MTYPE_NETNS_MISC, zns_info); - return 0; + return; } netnspath = zns_info->netnspath; if (--zns_info->retries == 0) @@ -249,34 +249,40 @@ static int zebra_ns_ready_read(struct thread *t) frr_with_privs(&zserv_privs) { err = ns_switch_to_netns(netnspath); } - if (err < 0) - return zebra_ns_continue_read(zns_info, stop_retry); + if (err < 0) { + zebra_ns_continue_read(zns_info, stop_retry); + return; + } /* go back to default ns */ frr_with_privs(&zserv_privs) { err = ns_switchback_to_initial(); } - if (err < 0) - return zebra_ns_continue_read(zns_info, stop_retry); + if (err < 0) { + zebra_ns_continue_read(zns_info, stop_retry); + return; + } /* check default name is not already set */ if (strmatch(VRF_DEFAULT_NAME, basename(netnspath))) { zlog_warn("NS notify : NS %s is already default VRF.Cancel VRF Creation", basename(netnspath)); - return zebra_ns_continue_read(zns_info, 1); + zebra_ns_continue_read(zns_info, 1); + return; } if (zebra_ns_notify_is_default_netns(basename(netnspath))) { zlog_warn( "NS notify : NS %s is default VRF. Ignore VRF creation", basename(netnspath)); - return zebra_ns_continue_read(zns_info, 1); + zebra_ns_continue_read(zns_info, 1); + return; } /* success : close fd and create zns context */ zebra_ns_notify_create_context_from_entry_name(basename(netnspath)); - return zebra_ns_continue_read(zns_info, 1); + zebra_ns_continue_read(zns_info, 1); } -static int zebra_ns_notify_read(struct thread *t) +static void zebra_ns_notify_read(struct thread *t) { int fd_monitor = THREAD_FD(t); struct inotify_event *event; @@ -290,7 +296,7 @@ static int zebra_ns_notify_read(struct thread *t) flog_err_sys(EC_ZEBRA_NS_NOTIFY_READ, "NS notify read: failed to read (%s)", safe_strerror(errno)); - return 0; + return; } for (event = (struct inotify_event *)buf; (char *)event < &buf[len]; event = (struct inotify_event *)((char *)event + sizeof(*event) @@ -329,7 +335,6 @@ static int zebra_ns_notify_read(struct thread *t) thread_add_timer_msec(zrouter.master, zebra_ns_ready_read, (void *)netnsinfo, 0, NULL); } - return 0; } void zebra_ns_notify_parse(void) diff --git a/zebra/zebra_opaque.c b/zebra/zebra_opaque.c index 244f16302..0a98194ac 100644 --- a/zebra/zebra_opaque.c +++ b/zebra/zebra_opaque.c @@ -106,7 +106,7 @@ static const char LOG_NAME[] = "Zebra Opaque"; /* Prototypes */ /* Main event loop, processing incoming message queue */ -static int process_messages(struct thread *event); +static void process_messages(struct thread *event); static int handle_opq_registration(const struct zmsghdr *hdr, struct stream *msg); static int handle_opq_unregistration(const struct zmsghdr *hdr, @@ -270,7 +270,7 @@ uint32_t zebra_opaque_enqueue_batch(struct stream_fifo *batch) /* * Pthread event loop, process the incoming message queue. */ -static int process_messages(struct thread *event) +static void process_messages(struct thread *event) { struct stream_fifo fifo; struct stream *msg; @@ -335,8 +335,6 @@ done: /* This will also free any leftover messages, in the shutdown case */ stream_fifo_deinit(&fifo); - - return 0; } /* diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 32edb78c7..68e5c391c 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -100,7 +100,7 @@ static ptm_lib_handle_t *ptm_hdl; struct zebra_ptm_cb ptm_cb; static int zebra_ptm_socket_init(void); -int zebra_ptm_sock_read(struct thread *); +void zebra_ptm_sock_read(struct thread *thread); static void zebra_ptm_install_commands(void); static int zebra_ptm_handle_msg_cb(void *arg, void *in_ctxt); void zebra_bfd_peer_replay_req(void); @@ -168,12 +168,12 @@ void zebra_ptm_finish(void) close(ptm_cb.ptm_sock); } -static int zebra_ptm_flush_messages(struct thread *thread) +static void zebra_ptm_flush_messages(struct thread *thread) { ptm_cb.t_write = NULL; if (ptm_cb.ptm_sock == -1) - return -1; + return; errno = 0; @@ -187,7 +187,7 @@ static int zebra_ptm_flush_messages(struct thread *thread) ptm_cb.t_timer = NULL; thread_add_timer(zrouter.master, zebra_ptm_connect, NULL, ptm_cb.reconnect_time, &ptm_cb.t_timer); - return -1; + return; case BUFFER_PENDING: ptm_cb.t_write = NULL; thread_add_write(zrouter.master, zebra_ptm_flush_messages, NULL, @@ -196,8 +196,6 @@ static int zebra_ptm_flush_messages(struct thread *thread) case BUFFER_EMPTY: break; } - - return 0; } static int zebra_ptm_send_message(char *data, int size) @@ -226,7 +224,7 @@ static int zebra_ptm_send_message(char *data, int size) return 0; } -int zebra_ptm_connect(struct thread *t) +void zebra_ptm_connect(struct thread *t) { int init = 0; @@ -255,8 +253,6 @@ int zebra_ptm_connect(struct thread *t) } else if (ptm_cb.reconnect_time >= ZEBRA_PTM_RECONNECT_TIME_MAX) { ptm_cb.reconnect_time = ZEBRA_PTM_RECONNECT_TIME_INITIAL; } - - return (errno); } DEFUN (zebra_ptm_enable, @@ -649,7 +645,7 @@ static int zebra_ptm_handle_msg_cb(void *arg, void *in_ctxt) } } -int zebra_ptm_sock_read(struct thread *thread) +void zebra_ptm_sock_read(struct thread *thread) { int sock; int rc; @@ -658,7 +654,7 @@ int zebra_ptm_sock_read(struct thread *thread) sock = THREAD_FD(thread); if (sock == -1) - return -1; + return; /* PTM communicates in CSV format */ do { @@ -679,14 +675,12 @@ int zebra_ptm_sock_read(struct thread *thread) thread_add_timer(zrouter.master, zebra_ptm_connect, NULL, ptm_cb.reconnect_time, &ptm_cb.t_timer); - return -1; + return; } ptm_cb.t_read = NULL; thread_add_read(zrouter.master, zebra_ptm_sock_read, NULL, ptm_cb.ptm_sock, &ptm_cb.t_read); - - return 0; } /* BFD peer/dst register/update */ diff --git a/zebra/zebra_ptm.h b/zebra/zebra_ptm.h index 88c9bccb4..f8e843cc7 100644 --- a/zebra/zebra_ptm.h +++ b/zebra/zebra_ptm.h @@ -74,7 +74,7 @@ struct zebra_ptm_cb { void zebra_ptm_init(void); void zebra_ptm_finish(void); -int zebra_ptm_connect(struct thread *t); +void zebra_ptm_connect(struct thread *t); void zebra_ptm_write(struct vty *vty); int zebra_ptm_get_enable_state(void); diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c index 57276974c..7d1153f21 100644 --- a/zebra/zebra_pw.c +++ b/zebra/zebra_pw.c @@ -47,7 +47,7 @@ DEFINE_HOOK(pw_uninstall, (struct zebra_pw * pw), (pw)); static int zebra_pw_enabled(struct zebra_pw *); static void zebra_pw_install(struct zebra_pw *); static void zebra_pw_uninstall(struct zebra_pw *); -static int zebra_pw_install_retry(struct thread *); +static void zebra_pw_install_retry(struct thread *thread); static int zebra_pw_check_reachability(const struct zebra_pw *); static void zebra_pw_update_status(struct zebra_pw *, int); @@ -226,14 +226,12 @@ void zebra_pw_install_failure(struct zebra_pw *pw, int pwstatus) zebra_pw_update_status(pw, pwstatus); } -static int zebra_pw_install_retry(struct thread *thread) +static void zebra_pw_install_retry(struct thread *thread) { struct zebra_pw *pw = THREAD_ARG(thread); pw->install_retry_timer = NULL; zebra_pw_install(pw); - - return 0; } static void zebra_pw_update_status(struct zebra_pw *pw, int status) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index eb9b80fce..c386fc487 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3948,7 +3948,7 @@ static void rib_update_ctx_fini(struct rib_update_ctx **ctx) XFREE(MTYPE_RIB_UPDATE_CTX, *ctx); } -static int rib_update_handler(struct thread *thread) +static void rib_update_handler(struct thread *thread) { struct rib_update_ctx *ctx; @@ -3960,8 +3960,6 @@ static int rib_update_handler(struct thread *thread) rib_update_handle_vrf(ctx->vrf_id, ctx->event, ZEBRA_ROUTE_ALL); rib_update_ctx_fini(&ctx); - - return 0; } /* @@ -4055,7 +4053,7 @@ void rib_sweep_table(struct route_table *table) } /* Sweep all RIB tables. */ -int rib_sweep_route(struct thread *t) +void rib_sweep_route(struct thread *t) { struct vrf *vrf; struct zebra_vrf *zvrf; @@ -4070,8 +4068,6 @@ int rib_sweep_route(struct thread *t) zebra_router_sweep_route(); zebra_router_sweep_nhgs(); - - return 0; } /* Remove specific by protocol routes from 'table'. */ @@ -4181,7 +4177,7 @@ done: * Handle results from the dataplane system. Dequeue update context * structs, dispatch to appropriate internal handlers. */ -static int rib_process_dplane_results(struct thread *thread) +static void rib_process_dplane_results(struct thread *thread) { struct zebra_dplane_ctx *ctx; struct dplane_ctx_q ctxlist; @@ -4349,8 +4345,6 @@ static int rib_process_dplane_results(struct thread *thread) } } while (1); - - return 0; } /* diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index 908c13f3d..e99cb7611 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -1638,7 +1638,7 @@ static void zebra_route_map_process_update_cb(char *rmap_name) zebra_nht_rm_update(rmap_name); } -static int zebra_route_map_update_timer(struct thread *thread) +static void zebra_route_map_update_timer(struct thread *thread) { if (IS_ZEBRA_DEBUG_EVENT) zlog_debug("Event driven route-map update triggered"); @@ -1655,7 +1655,6 @@ static int zebra_route_map_update_timer(struct thread *thread) * 1) VRF Aware <sigh> * 2) Route-map aware */ - return 0; } static void zebra_route_map_set_delay_timer(uint32_t value) diff --git a/zebra/zserv.c b/zebra/zserv.c index f3f69661c..630c76c98 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -216,7 +216,7 @@ static void zserv_client_fail(struct zserv *client) * allows us to expose information about input and output queues to the user in * terms of number of packets rather than size of data. */ -static int zserv_write(struct thread *thread) +static void zserv_write(struct thread *thread) { struct zserv *client = THREAD_ARG(thread); struct stream *msg; @@ -232,7 +232,7 @@ static int zserv_write(struct thread *thread) (uint32_t)monotime(NULL), memory_order_relaxed); zserv_client_event(client, ZSERV_CLIENT_WRITE); - return 0; + return; case BUFFER_EMPTY: break; } @@ -268,7 +268,7 @@ static int zserv_write(struct thread *thread) (uint32_t)monotime(NULL), memory_order_relaxed); zserv_client_event(client, ZSERV_CLIENT_WRITE); - return 0; + return; case BUFFER_EMPTY: break; } @@ -279,14 +279,13 @@ static int zserv_write(struct thread *thread) atomic_store_explicit(&client->last_write_time, (uint32_t)monotime(NULL), memory_order_relaxed); - return 0; + return; zwrite_fail: flog_warn(EC_ZEBRA_CLIENT_WRITE_FAILED, "%s: could not write to %s [fd = %d], closing.", __func__, zebra_route_string(client->proto), client->sock); zserv_client_fail(client); - return 0; } /* @@ -311,7 +310,7 @@ zwrite_fail: * * Any failure in any of these actions is handled by terminating the client. */ -static int zserv_read(struct thread *thread) +static void zserv_read(struct thread *thread) { struct zserv *client = THREAD_ARG(thread); int sock; @@ -453,12 +452,11 @@ static int zserv_read(struct thread *thread) stream_fifo_free(cache); - return 0; + return; zread_fail: stream_fifo_free(cache); zserv_client_fail(client); - return -1; } static void zserv_client_event(struct zserv *client, @@ -495,7 +493,7 @@ static void zserv_client_event(struct zserv *client, * rely on the read thread to handle queuing this task enough times to process * everything on the input queue. */ -static int zserv_process_messages(struct thread *thread) +static void zserv_process_messages(struct thread *thread) { struct zserv *client = THREAD_ARG(thread); struct stream *msg; @@ -529,8 +527,6 @@ static int zserv_process_messages(struct thread *thread) /* Reschedule ourselves if necessary */ if (need_resched) zserv_event(client, ZSERV_PROCESS_MESSAGES); - - return 0; } int zserv_send_message(struct zserv *client, struct stream *msg) @@ -714,12 +710,11 @@ void zserv_close_client(struct zserv *client) * already have been closed and the thread will most likely have died, but its * resources still need to be cleaned up. */ -static int zserv_handle_client_fail(struct thread *thread) +static void zserv_handle_client_fail(struct thread *thread) { struct zserv *client = THREAD_ARG(thread); zserv_close_client(client); - return 0; } /* @@ -853,7 +848,7 @@ void zserv_release_client(struct zserv *client) /* * Accept socket connection. */ -static int zserv_accept(struct thread *thread) +static void zserv_accept(struct thread *thread) { int accept_sock; int client_sock; @@ -871,7 +866,7 @@ static int zserv_accept(struct thread *thread) if (client_sock < 0) { flog_err_sys(EC_LIB_SOCKET, "Can't accept zebra socket: %s", safe_strerror(errno)); - return -1; + return; } /* Make client socket non-blocking. */ @@ -879,8 +874,6 @@ static int zserv_accept(struct thread *thread) /* Create new zebra client. */ zserv_client_create(client_sock); - - return 0; } void zserv_close(void) diff --git a/zebra/zserv.h b/zebra/zserv.h index 203670ac1..7a5be001b 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -379,7 +379,7 @@ void zserv_log_message(const char *errmsg, struct stream *msg, struct zmsghdr *hdr); /* TODO */ -__attribute__((__noreturn__)) int zebra_finalize(struct thread *event); +__attribute__((__noreturn__)) void zebra_finalize(struct thread *event); /* * Graceful restart functions. |