diff options
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_bmp.c | 23 | ||||
-rw-r--r-- | bgpd/bgp_conditional_adv.c | 3 | ||||
-rw-r--r-- | bgpd/bgp_damp.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_dump.c | 6 | ||||
-rw-r--r-- | bgpd/bgp_evpn_mh.c | 6 | ||||
-rw-r--r-- | bgpd/bgp_fsm.c | 84 | ||||
-rw-r--r-- | bgpd/bgp_fsm.h | 4 | ||||
-rw-r--r-- | bgpd/bgp_io.c | 16 | ||||
-rw-r--r-- | bgpd/bgp_network.c | 22 | ||||
-rw-r--r-- | bgpd/bgp_nht.c | 8 | ||||
-rw-r--r-- | bgpd/bgp_packet.c | 26 | ||||
-rw-r--r-- | bgpd/bgp_packet.h | 6 | ||||
-rw-r--r-- | bgpd/bgp_route.c | 36 | ||||
-rw-r--r-- | bgpd/bgp_routemap.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_rpki.c | 9 | ||||
-rw-r--r-- | bgpd/bgp_updgrp.c | 7 | ||||
-rw-r--r-- | bgpd/bgp_updgrp.h | 2 | ||||
-rw-r--r-- | bgpd/bgp_updgrp_adv.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_zebra.c | 3 | ||||
-rw-r--r-- | bgpd/bgpd.c | 4 | ||||
-rw-r--r-- | bgpd/bgpd.h | 2 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_import.c | 14 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_import.h | 2 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_monitor.c | 7 | ||||
-rw-r--r-- | bgpd/rfapi/rfapi_rib.c | 4 | ||||
-rw-r--r-- | bgpd/rfapi/vnc_export_bgp.c | 4 |
26 files changed, 110 insertions, 200 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 1c9852f5c..96c34f919 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -1315,7 +1315,7 @@ static void bmp_stat_put_u32(struct stream *s, size_t *cnt, uint16_t type, (*cnt)++; } -static int bmp_stats(struct thread *thread) +static void bmp_stats(struct thread *thread) { struct bmp_targets *bt = THREAD_ARG(thread); struct stream *s; @@ -1365,11 +1365,10 @@ static int bmp_stats(struct thread *thread) bmp_send_all(bt->bmpbgp, s); } - return 0; } /* read from the BMP socket to detect session termination */ -static int bmp_read(struct thread *t) +static void bmp_read(struct thread *t) { struct bmp *bmp = THREAD_ARG(t); char buf[1024]; @@ -1383,16 +1382,14 @@ static int bmp_read(struct thread *t) } else if (n == 0) { /* the TCP session was terminated by the far end */ bmp_wrerr(bmp, NULL, true); - return 0; + return; } else if (!(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)) { /* the TCP session experienced a fatal error, likely a timeout */ bmp_wrerr(bmp, NULL, false); - return -1; + return; } thread_add_read(bm->master, bmp_read, bmp, bmp->socket, &bmp->t_read); - - return 0; } static struct bmp *bmp_open(struct bmp_targets *bt, int bmp_sock) @@ -1475,7 +1472,7 @@ static struct bmp *bmp_open(struct bmp_targets *bt, int bmp_sock) } /* Accept BMP connection. */ -static int bmp_accept(struct thread *thread) +static void bmp_accept(struct thread *thread) { union sockunion su; struct bmp_listener *bl = THREAD_ARG(thread); @@ -1490,10 +1487,9 @@ static int bmp_accept(struct thread *thread) bmp_sock = sockunion_accept(bl->sock, &su); if (bmp_sock < 0) { zlog_info("bmp: accept_sock failed: %s", safe_strerror(errno)); - return -1; + return; } bmp_open(bl->targets, bmp_sock); - return 0; } static void bmp_close(struct bmp *bmp) @@ -1837,7 +1833,7 @@ static void bmp_active_resolved(struct resolver_query *resq, const char *errstr, bmp_active_connect(ba); } -static int bmp_active_thread(struct thread *t) +static void bmp_active_thread(struct thread *t) { struct bmp_active *ba = THREAD_ARG(t); socklen_t slen; @@ -1861,7 +1857,7 @@ static int bmp_active_thread(struct thread *t) vrf_id = ba->targets->bgp->vrf_id; resolver_resolve(&ba->resq, AF_UNSPEC, vrf_id, ba->hostname, bmp_active_resolved); - return 0; + return; } slen = sizeof(status); @@ -1886,14 +1882,13 @@ static int bmp_active_thread(struct thread *t) ba->bmp->active = ba; ba->socket = -1; ba->curretry = ba->minretry; - return 0; + return; out_next: close(ba->socket); ba->socket = -1; ba->addrpos++; bmp_active_connect(ba); - return 0; } static void bmp_active_disconnected(struct bmp_active *ba) diff --git a/bgpd/bgp_conditional_adv.c b/bgpd/bgp_conditional_adv.c index e5a4b0e9f..f72a373a1 100644 --- a/bgpd/bgp_conditional_adv.c +++ b/bgpd/bgp_conditional_adv.c @@ -165,7 +165,7 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi, /* Handler of conditional advertisement timer event. * Each route in the condition-map is evaluated. */ -static int bgp_conditional_adv_timer(struct thread *t) +static void bgp_conditional_adv_timer(struct thread *t) { afi_t afi; safi_t safi; @@ -286,7 +286,6 @@ static int bgp_conditional_adv_timer(struct thread *t) } peer->advmap_table_change = false; } - return 0; } void bgp_conditional_adv_enable(struct peer *peer, afi_t afi, safi_t safi) diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index 91e983e5d..62e8e71aa 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -113,7 +113,7 @@ int bgp_damp_decay(time_t tdiff, int penalty, struct bgp_damp_config *bdc) /* Handler of reuse timer event. Each route in the current reuse-list is evaluated. RFC2439 Section 4.8.7. */ -static int bgp_reuse_timer(struct thread *t) +static void bgp_reuse_timer(struct thread *t) { struct bgp_damp_info *bdi; struct bgp_damp_info *next; @@ -178,8 +178,6 @@ static int bgp_reuse_timer(struct thread *t) * 4.8.6). */ bgp_reuse_list_add(bdi, bdc); } - - return 0; } /* A route becomes unreachable (RFC2439 Section 4.8.2). */ diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index 9ddfe7bb5..c389fec5f 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -88,7 +88,7 @@ struct bgp_dump { }; static int bgp_dump_unset(struct bgp_dump *bgp_dump); -static int bgp_dump_interval_func(struct thread *); +static void bgp_dump_interval_func(struct thread *); /* BGP packet dump output buffer. */ struct stream *bgp_dump_obuf; @@ -439,7 +439,7 @@ static unsigned int bgp_dump_routes_func(int afi, int first_run, return seq; } -static int bgp_dump_interval_func(struct thread *t) +static void bgp_dump_interval_func(struct thread *t) { struct bgp_dump *bgp_dump; bgp_dump = THREAD_ARG(t); @@ -462,8 +462,6 @@ static int bgp_dump_interval_func(struct thread *t) /* if interval is set reschedule */ if (bgp_dump->interval > 0) bgp_dump_interval_add(bgp_dump, bgp_dump->interval); - - return 0; } /* Dump common information. */ diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index 9b184ac9c..ea179ec2b 100644 --- a/bgpd/bgp_evpn_mh.c +++ b/bgpd/bgp_evpn_mh.c @@ -76,7 +76,7 @@ static void bgp_evpn_mac_update_on_es_local_chg(struct bgp_evpn_es *es, bool is_local); esi_t zero_esi_buf, *zero_esi = &zero_esi_buf; -static int bgp_evpn_run_consistency_checks(struct thread *t); +static void bgp_evpn_run_consistency_checks(struct thread *t); static void bgp_evpn_path_nh_info_free(struct bgp_path_evpn_nh_info *nh_info); static void bgp_evpn_path_nh_unlink(struct bgp_path_evpn_nh_info *nh_info); @@ -4122,7 +4122,7 @@ static uint32_t bgp_evpn_es_run_consistency_checks(struct bgp_evpn_es *es) return proc_cnt; } -static int bgp_evpn_run_consistency_checks(struct thread *t) +static void bgp_evpn_run_consistency_checks(struct thread *t) { int proc_cnt = 0; int es_cnt = 0; @@ -4147,8 +4147,6 @@ static int bgp_evpn_run_consistency_checks(struct thread *t) thread_add_timer(bm->master, bgp_evpn_run_consistency_checks, NULL, BGP_EVPN_CONS_CHECK_INTERVAL, &bgp_mh_info->t_cons_check); - - return 0; } /***************************************************************************** diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 672fa4512..a0b92b6c7 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -90,13 +90,13 @@ static const char *const bgp_event_str[] = { function. */ /* BGP event function. */ -int bgp_event(struct thread *); +void bgp_event(struct thread *); /* BGP thread functions. */ -static int bgp_start_timer(struct thread *); -static int bgp_connect_timer(struct thread *); -static int bgp_holdtime_timer(struct thread *); -static int bgp_delayopen_timer(struct thread *); +static void bgp_start_timer(struct thread *); +static void bgp_connect_timer(struct thread *); +static void bgp_holdtime_timer(struct thread *); +static void bgp_delayopen_timer(struct thread *); /* BGP FSM functions. */ static int bgp_start(struct peer *); @@ -494,7 +494,7 @@ void bgp_timer_set(struct peer *peer) /* BGP start timer. This function set BGP_Start event to thread value and process event. */ -static int bgp_start_timer(struct thread *thread) +static void bgp_start_timer(struct thread *thread) { struct peer *peer; @@ -505,15 +505,12 @@ static int bgp_start_timer(struct thread *thread) THREAD_VAL(thread) = BGP_Start; bgp_event(thread); /* bgp_event unlocks peer */ - - return 0; } /* BGP connect retry timer. */ -static int bgp_connect_timer(struct thread *thread) +static void bgp_connect_timer(struct thread *thread) { struct peer *peer; - int ret; peer = THREAD_ARG(thread); @@ -526,20 +523,16 @@ static int bgp_connect_timer(struct thread *thread) if (bgp_debug_neighbor_events(peer)) zlog_debug("%s [FSM] Timer (connect timer expire)", peer->host); - if (CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER)) { + if (CHECK_FLAG(peer->sflags, PEER_STATUS_ACCEPT_PEER)) bgp_stop(peer); - ret = -1; - } else { + else { THREAD_VAL(thread) = ConnectRetry_timer_expired; bgp_event(thread); /* bgp_event unlocks peer */ - ret = 0; } - - return ret; } /* BGP holdtime timer. */ -static int bgp_holdtime_timer(struct thread *thread) +static void bgp_holdtime_timer(struct thread *thread) { atomic_size_t inq_count; struct peer *peer; @@ -562,20 +555,15 @@ static int bgp_holdtime_timer(struct thread *thread) */ inq_count = atomic_load_explicit(&peer->ibuf->count, memory_order_relaxed); - if (inq_count) { + if (inq_count) BGP_TIMER_ON(peer->t_holdtime, bgp_holdtime_timer, peer->v_holdtime); - return 0; - } - THREAD_VAL(thread) = Hold_Timer_expired; bgp_event(thread); /* bgp_event unlocks peer */ - - return 0; } -int bgp_routeadv_timer(struct thread *thread) +void bgp_routeadv_timer(struct thread *thread) { struct peer *peer; @@ -593,11 +581,10 @@ int bgp_routeadv_timer(struct thread *thread) /* MRAI timer will be started again when FIFO is built, no need to * do it here. */ - return 0; } /* RFC 4271 DelayOpenTimer */ -int bgp_delayopen_timer(struct thread *thread) +void bgp_delayopen_timer(struct thread *thread) { struct peer *peer; @@ -609,8 +596,6 @@ int bgp_delayopen_timer(struct thread *thread) THREAD_VAL(thread) = DelayOpen_timer_expired; bgp_event(thread); /* bgp_event unlocks peer */ - - return 0; } /* BGP Peer Down Cause */ @@ -674,7 +659,7 @@ static void bgp_graceful_restart_timer_off(struct peer *peer) bgp_timer_set(peer); } -static int bgp_llgr_stale_timer_expire(struct thread *thread) +static void bgp_llgr_stale_timer_expire(struct thread *thread) { struct peer_af *paf; struct peer *peer; @@ -700,8 +685,6 @@ static int bgp_llgr_stale_timer_expire(struct thread *thread) bgp_clear_stale_route(peer, afi, safi); bgp_graceful_restart_timer_off(peer); - - return 0; } static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi) @@ -776,7 +759,7 @@ static void bgp_set_llgr_stale(struct peer *peer, afi_t afi, safi_t safi) } } -static int bgp_graceful_restart_timer_expire(struct thread *thread) +static void bgp_graceful_restart_timer_expire(struct thread *thread) { struct peer *peer, *tmp_peer; struct listnode *node, *nnode; @@ -840,11 +823,9 @@ static int bgp_graceful_restart_timer_expire(struct thread *thread) } bgp_graceful_restart_timer_off(peer); - - return 0; } -static int bgp_graceful_stale_timer_expire(struct thread *thread) +static void bgp_graceful_stale_timer_expire(struct thread *thread) { struct peer *peer; afi_t afi; @@ -860,12 +841,10 @@ static int bgp_graceful_stale_timer_expire(struct thread *thread) FOREACH_AFI_SAFI_NSF (afi, safi) if (peer->nsf[afi][safi]) bgp_clear_stale_route(peer, afi, safi); - - return 0; } /* Selection deferral timer processing function */ -static int bgp_graceful_deferral_timer_expire(struct thread *thread) +static void bgp_graceful_deferral_timer_expire(struct thread *thread) { struct afi_safi_info *info; afi_t afi; @@ -887,7 +866,7 @@ static int bgp_graceful_deferral_timer_expire(struct thread *thread) XFREE(MTYPE_TMP, info); /* Best path selection */ - return bgp_best_path_select_defer(bgp, afi, safi); + bgp_best_path_select_defer(bgp, afi, safi); } static bool bgp_update_delay_applicable(struct bgp *bgp) @@ -1135,7 +1114,7 @@ int bgp_fsm_error_subcode(int status) } /* The maxmed onstartup timer expiry callback. */ -static int bgp_maxmed_onstartup_timer(struct thread *thread) +static void bgp_maxmed_onstartup_timer(struct thread *thread) { struct bgp *bgp; @@ -1146,8 +1125,6 @@ static int bgp_maxmed_onstartup_timer(struct thread *thread) bgp->maxmed_onstartup_over = 1; bgp_maxmed_update(bgp); - - return 0; } static void bgp_maxmed_onstartup_begin(struct bgp *bgp) @@ -1179,7 +1156,7 @@ static void bgp_maxmed_onstartup_process_status_change(struct peer *peer) } /* The update delay timer expiry callback. */ -static int bgp_update_delay_timer(struct thread *thread) +static void bgp_update_delay_timer(struct thread *thread) { struct bgp *bgp; @@ -1188,12 +1165,10 @@ static int bgp_update_delay_timer(struct thread *thread) bgp = THREAD_ARG(thread); THREAD_OFF(bgp->t_update_delay); bgp_update_delay_end(bgp); - - return 0; } /* The establish wait timer expiry callback. */ -static int bgp_establish_wait_timer(struct thread *thread) +static void bgp_establish_wait_timer(struct thread *thread) { struct bgp *bgp; @@ -1202,8 +1177,6 @@ static int bgp_establish_wait_timer(struct thread *thread) bgp = THREAD_ARG(thread); THREAD_OFF(bgp->t_establish_wait); bgp_check_update_delay(bgp); - - return 0; } /* Steps to begin the update delay: @@ -1660,7 +1633,7 @@ static int bgp_stop_with_notify(struct peer *peer, uint8_t code, * when the connection is established. A read event is triggered when the * connection is closed. Thus we need to cancel whichever one did not occur. */ -static int bgp_connect_check(struct thread *thread) +static void bgp_connect_check(struct thread *thread) { int status; socklen_t slen; @@ -1686,7 +1659,7 @@ static int bgp_connect_check(struct thread *thread) zlog_err("can't get sockopt for nonblocking connect: %d(%s)", errno, safe_strerror(errno)); BGP_EVENT_ADD(peer, TCP_fatal_error); - return -1; + return; } /* When status is 0 then TCP connection is established. */ @@ -1695,13 +1668,13 @@ static int bgp_connect_check(struct thread *thread) BGP_EVENT_ADD(peer, TCP_connection_open_w_delay); else BGP_EVENT_ADD(peer, TCP_connection_open); - return 1; + return; } else { if (bgp_debug_neighbor_events(peer)) zlog_debug("%s [Event] Connect failed %d(%s)", peer->host, status, safe_strerror(status)); BGP_EVENT_ADD(peer, TCP_connection_open_failed); - return 0; + return; } } @@ -2542,18 +2515,15 @@ static const struct { }; /* Execute event process. */ -int bgp_event(struct thread *thread) +void bgp_event(struct thread *thread) { enum bgp_fsm_events event; struct peer *peer; - int ret; peer = THREAD_ARG(thread); event = THREAD_VAL(thread); - ret = bgp_event_update(peer, event); - - return (ret); + bgp_event_update(peer, event); } int bgp_event_update(struct peer *peer, enum bgp_fsm_events event) diff --git a/bgpd/bgp_fsm.h b/bgpd/bgp_fsm.h index 12cbad3eb..f3d1781ed 100644 --- a/bgpd/bgp_fsm.h +++ b/bgpd/bgp_fsm.h @@ -125,11 +125,11 @@ * Update FSM for peer based on whether we have valid nexthops or not. */ extern void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops); -extern int bgp_event(struct thread *); +extern void bgp_event(struct thread *); extern int bgp_event_update(struct peer *, enum bgp_fsm_events event); extern int bgp_stop(struct peer *peer); extern void bgp_timer_set(struct peer *); -extern int bgp_routeadv_timer(struct thread *); +extern void bgp_routeadv_timer(struct thread *); extern void bgp_fsm_change_status(struct peer *peer, int status); extern const char *const peer_down_str[]; extern void bgp_update_delay_end(struct bgp *); diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c index 9b5a31f28..bd0dfb3a6 100644 --- a/bgpd/bgp_io.c +++ b/bgpd/bgp_io.c @@ -45,8 +45,8 @@ /* forward declarations */ static uint16_t bgp_write(struct peer *); static uint16_t bgp_read(struct peer *peer, int *code_p); -static int bgp_process_writes(struct thread *); -static int bgp_process_reads(struct thread *); +static void bgp_process_writes(struct thread *); +static void bgp_process_reads(struct thread *); static bool validate_header(struct peer *); /* generic i/o status codes */ @@ -121,7 +121,7 @@ void bgp_reads_off(struct peer *peer) /* * Called from I/O pthread when a file descriptor has become ready for writing. */ -static int bgp_process_writes(struct thread *thread) +static void bgp_process_writes(struct thread *thread) { static struct peer *peer; peer = THREAD_ARG(thread); @@ -130,7 +130,7 @@ static int bgp_process_writes(struct thread *thread) bool fatal = false; if (peer->fd < 0) - return -1; + return; struct frr_pthread *fpt = bgp_pth_io; @@ -161,8 +161,6 @@ static int bgp_process_writes(struct thread *thread) BGP_UPDATE_GROUP_TIMER_ON(&peer->t_generate_updgrp_packets, bgp_generate_updgrp_packets); } - - return 0; } /* @@ -172,7 +170,7 @@ static int bgp_process_writes(struct thread *thread) * We read as much data as possible, process as many packets as we can and * place them on peer->ibuf for secondary processing by the main thread. */ -static int bgp_process_reads(struct thread *thread) +static void bgp_process_reads(struct thread *thread) { /* clang-format off */ static struct peer *peer; // peer to read from @@ -186,7 +184,7 @@ static int bgp_process_reads(struct thread *thread) peer = THREAD_ARG(thread); if (peer->fd < 0 || bm->terminating) - return -1; + return; struct frr_pthread *fpt = bgp_pth_io; @@ -271,8 +269,6 @@ static int bgp_process_reads(struct thread *thread) thread_add_event(bm->master, bgp_process_packet, peer, 0, &peer->t_process_packet); } - - return 0; } /* diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c index 3fb7619ed..0c325b678 100644 --- a/bgpd/bgp_network.c +++ b/bgpd/bgp_network.c @@ -342,7 +342,7 @@ static void bgp_socket_set_buffer_size(const int fd) } /* Accept bgp connection. */ -static int bgp_accept(struct thread *thread) +static void bgp_accept(struct thread *thread) { int bgp_sock; int accept_sock; @@ -363,7 +363,7 @@ static int bgp_accept(struct thread *thread) flog_err_sys(EC_LIB_SOCKET, "[Error] BGP accept socket fd is negative: %d", accept_sock); - return -1; + return; } thread_add_read(bm->master, bgp_accept, listener, accept_sock, @@ -402,7 +402,7 @@ static int bgp_accept(struct thread *thread) "[Error] BGP socket accept failed (%s); retrying", safe_strerror(save_errno)); } - return -1; + return; } set_nonblocking(bgp_sock); @@ -418,7 +418,7 @@ static int bgp_accept(struct thread *thread) "[Event] Could not get instance for incoming conn from %s", inet_sutop(&su, buf)); close(bgp_sock); - return -1; + return; } bgp_socket_set_buffer_size(bgp_sock); @@ -451,7 +451,7 @@ static int bgp_accept(struct thread *thread) TCP_connection_open); } - return 0; + return; } } @@ -463,7 +463,7 @@ static int bgp_accept(struct thread *thread) VRF_LOGNAME(vrf_lookup_by_id(bgp->vrf_id))); } close(bgp_sock); - return -1; + return; } if (CHECK_FLAG(peer1->flags, PEER_FLAG_SHUTDOWN) @@ -474,7 +474,7 @@ static int bgp_accept(struct thread *thread) inet_sutop(&su, buf), bgp->name_pretty, bgp->as, VRF_LOGNAME(vrf_lookup_by_id(bgp->vrf_id))); close(bgp_sock); - return -1; + return; } /* @@ -489,7 +489,7 @@ static int bgp_accept(struct thread *thread) "[Event] Closing incoming conn for %s (%p) state %d", peer1->host, peer1, peer1->status); close(bgp_sock); - return -1; + return; } /* Check that at least one AF is activated for the peer. */ @@ -499,7 +499,7 @@ static int bgp_accept(struct thread *thread) "%s - incoming conn rejected - no AF activated for peer", peer1->host); close(bgp_sock); - return -1; + return; } /* Do not try to reconnect if the peer reached maximum @@ -512,7 +512,7 @@ static int bgp_accept(struct thread *thread) "[Event] Incoming BGP connection rejected from %s due to maximum-prefix or shutdown", peer1->host); close(bgp_sock); - return -1; + return; } if (bgp_debug_neighbor_events(peer1)) @@ -600,8 +600,6 @@ static int bgp_accept(struct thread *thread) * massage the event system to make things happy */ bgp_nht_interface_events(peer); - - return 0; } /* BGP socket bind. */ diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index 19ae13720..8313c12e6 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -54,7 +54,7 @@ static void register_zebra_rnh(struct bgp_nexthop_cache *bnc, static void unregister_zebra_rnh(struct bgp_nexthop_cache *bnc, int is_bgp_static_route); static int make_prefix(int afi, struct bgp_path_info *pi, struct prefix *p); -static int bgp_nht_ifp_initial(struct thread *thread); +static void bgp_nht_ifp_initial(struct thread *thread); static int bgp_isvalid_nexthop(struct bgp_nexthop_cache *bnc) { @@ -608,14 +608,14 @@ void bgp_nht_ifp_down(struct interface *ifp) bgp_nht_ifp_handle(ifp, false); } -static int bgp_nht_ifp_initial(struct thread *thread) +static void bgp_nht_ifp_initial(struct thread *thread) { ifindex_t ifindex = THREAD_VAL(thread); struct bgp *bgp = THREAD_ARG(thread); struct interface *ifp = if_lookup_by_index(ifindex, bgp->vrf_id); if (!ifp) - return 0; + return; if (BGP_DEBUG(nht, NHT)) zlog_debug( @@ -626,8 +626,6 @@ static int bgp_nht_ifp_initial(struct thread *thread) bgp_nht_ifp_up(ifp); else bgp_nht_ifp_down(ifp); - - return 0; } /* diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 4bb08404d..8fac36cf6 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -386,7 +386,7 @@ static void bgp_write_proceed_actions(struct peer *peer) * update group a peer belongs to, encode this information into packets, and * enqueue the packets onto the peer's output buffer. */ -int bgp_generate_updgrp_packets(struct thread *thread) +void bgp_generate_updgrp_packets(struct thread *thread) { struct peer *peer = THREAD_ARG(thread); @@ -407,14 +407,14 @@ int bgp_generate_updgrp_packets(struct thread *thread) * update-delay processing). */ if (!peer_established(peer)) - return 0; + return; if ((peer->bgp->main_peers_update_hold) || bgp_update_delay_active(peer->bgp)) - return 0; + return; if (peer->t_routeadv) - return 0; + return; do { enum bgp_af_index index; @@ -541,8 +541,6 @@ int bgp_generate_updgrp_packets(struct thread *thread) bgp_writes_on(peer); bgp_write_proceed_actions(peer); - - return 0; } /* @@ -1540,7 +1538,7 @@ static int bgp_keepalive_receive(struct peer *peer, bgp_size_t size) return Receive_KEEPALIVE_message; } -static int bgp_refresh_stalepath_timer_expire(struct thread *thread) +static void bgp_refresh_stalepath_timer_expire(struct thread *thread) { struct peer_af *paf; @@ -1560,8 +1558,6 @@ static int bgp_refresh_stalepath_timer_expire(struct thread *thread) peer->host, afi2str(afi), safi2str(safi)); bgp_timer_set(peer); - - return 0; } /** @@ -2573,7 +2569,7 @@ int bgp_capability_receive(struct peer *peer, bgp_size_t size) * @param thread * @return 0 */ -int bgp_process_packet(struct thread *thread) +void bgp_process_packet(struct thread *thread) { /* Yes first of all get peer pointer. */ struct peer *peer; // peer @@ -2588,7 +2584,7 @@ int bgp_process_packet(struct thread *thread) /* Guard against scheduled events that occur after peer deletion. */ if (peer->status == Deleted || peer->status == Clearing) - return 0; + return; unsigned int processed = 0; @@ -2602,7 +2598,7 @@ int bgp_process_packet(struct thread *thread) } if (peer->curr == NULL) // no packets to process, hmm... - return 0; + return; /* skip the marker and copy the packet length */ stream_forward_getp(peer->curr, BGP_MARKER_SIZE); @@ -2732,8 +2728,6 @@ int bgp_process_packet(struct thread *thread) &peer->t_process_packet); } } - - return 0; } /* Send EOR when routes are processed by selection deferral timer */ @@ -2752,7 +2746,7 @@ void bgp_send_delayed_eor(struct bgp *bgp) * having the io pthread try to enqueue fsm events or mess with the peer * struct. */ -int bgp_packet_process_error(struct thread *thread) +void bgp_packet_process_error(struct thread *thread) { struct peer *peer; int code; @@ -2777,6 +2771,4 @@ int bgp_packet_process_error(struct thread *thread) } bgp_event_update(peer, code); - - return 0; } diff --git a/bgpd/bgp_packet.h b/bgpd/bgp_packet.h index 280d3ec17..8c2de6d62 100644 --- a/bgpd/bgp_packet.h +++ b/bgpd/bgp_packet.h @@ -79,12 +79,12 @@ extern void bgp_check_update_delay(struct bgp *); extern int bgp_packet_set_marker(struct stream *s, uint8_t type); extern void bgp_packet_set_size(struct stream *s); -extern int bgp_generate_updgrp_packets(struct thread *); -extern int bgp_process_packet(struct thread *); +extern void bgp_generate_updgrp_packets(struct thread *); +extern void bgp_process_packet(struct thread *); extern void bgp_send_delayed_eor(struct bgp *bgp); /* Task callback to handle socket error encountered in the io pthread */ -int bgp_packet_process_error(struct thread *thread); +void bgp_packet_process_error(struct thread *thread); #endif /* _QUAGGA_BGP_PACKET_H */ diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 0238e36cd..bd7031def 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2402,7 +2402,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi, return true; } -static int bgp_route_select_timer_expire(struct thread *thread) +static void bgp_route_select_timer_expire(struct thread *thread) { struct afi_safi_info *info; afi_t afi; @@ -2423,7 +2423,7 @@ static int bgp_route_select_timer_expire(struct thread *thread) XFREE(MTYPE_TMP, info); /* Best path selection */ - return bgp_best_path_select_defer(bgp, afi, safi); + bgp_best_path_select_defer(bgp, afi, safi); } void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest, @@ -3354,7 +3354,7 @@ void bgp_add_eoiu_mark(struct bgp *bgp) work_queue_add(bgp->process_queue, pqnode); } -static int bgp_maximum_prefix_restart_timer(struct thread *thread) +static void bgp_maximum_prefix_restart_timer(struct thread *thread) { struct peer *peer; @@ -3368,8 +3368,6 @@ static int bgp_maximum_prefix_restart_timer(struct thread *thread) if ((peer_clear(peer, NULL) < 0) && bgp_debug_neighbor_events(peer)) zlog_debug("%s: %s peer_clear failed", __func__, peer->host); - - return 0; } static uint32_t bgp_filtered_routes_count(struct peer *peer, afi_t afi, @@ -4710,7 +4708,7 @@ void bgp_stop_announce_route_timer(struct peer_af *paf) * Callback that is invoked when the route announcement timer for a * peer_af expires. */ -static int bgp_announce_route_timer_expired(struct thread *t) +static void bgp_announce_route_timer_expired(struct thread *t) { struct peer_af *paf; struct peer *peer; @@ -4719,17 +4717,15 @@ static int bgp_announce_route_timer_expired(struct thread *t) peer = paf->peer; if (!peer_established(peer)) - return 0; + return; if (!peer->afc_nego[paf->afi][paf->safi]) - return 0; + return; peer_af_announce_route(paf, 1); /* Notify BGP conditional advertisement scanner percess */ peer->advmap_config_change[paf->afi][paf->safi] = true; - - return 0; } /* @@ -4879,7 +4875,7 @@ static void bgp_soft_reconfig_table(struct peer *peer, afi_t afi, safi_t safi, * Without splitting the full job into several part, * vtysh waits for the job to finish before responding to a BGP command */ -static int bgp_soft_reconfig_table_task(struct thread *thread) +static void bgp_soft_reconfig_table_task(struct thread *thread) { uint32_t iter, max_iter; int ret; @@ -4933,7 +4929,7 @@ static int bgp_soft_reconfig_table_task(struct thread *thread) &table->soft_reconfig_peers); bgp_soft_reconfig_table_flag( table, false); - return 0; + return; } } } @@ -4947,7 +4943,7 @@ static int bgp_soft_reconfig_table_task(struct thread *thread) table->soft_reconfig_init = false; thread_add_event(bm->master, bgp_soft_reconfig_table_task, table, 0, &table->soft_reconfig_thread); - return 0; + return; } /* we're done, clean up the background iteration context info and schedule route annoucement @@ -4958,8 +4954,6 @@ static int bgp_soft_reconfig_table_task(struct thread *thread) } list_delete(&table->soft_reconfig_peers); - - return 0; } @@ -12854,7 +12848,7 @@ static void bgp_table_stats_rn(struct bgp_dest *dest, struct bgp_dest *top, } } -static int bgp_table_stats_walker(struct thread *t) +static void bgp_table_stats_walker(struct thread *t) { struct bgp_dest *dest, *ndest; struct bgp_dest *top; @@ -12862,7 +12856,7 @@ static int bgp_table_stats_walker(struct thread *t) unsigned int space = 0; if (!(top = bgp_table_top(ts->table))) - return 0; + return; switch (ts->table->afi) { case AFI_IP: @@ -12875,7 +12869,7 @@ static int bgp_table_stats_walker(struct thread *t) space = EVPN_ROUTE_PREFIXLEN; break; default: - return 0; + return; } ts->counts[BGP_STATS_MAXBITLEN] = space; @@ -12898,8 +12892,6 @@ static int bgp_table_stats_walker(struct thread *t) bgp_table_stats_rn(dest, top, ts, space); } } - - return 0; } static void bgp_table_stats_all(struct vty *vty, afi_t afi, safi_t safi, @@ -13217,7 +13209,7 @@ static void bgp_peer_count_proc(struct bgp_dest *rn, struct peer_pcounts *pc) } } -static int bgp_peer_count_walker(struct thread *t) +static void bgp_peer_count_walker(struct thread *t) { struct bgp_dest *rn, *rm; const struct bgp_table *table; @@ -13237,8 +13229,6 @@ static int bgp_peer_count_walker(struct thread *t) } else for (rn = bgp_table_top(pc->table); rn; rn = bgp_route_next(rn)) bgp_peer_count_proc(rn, pc); - - return 0; } static int bgp_peer_counts(struct vty *vty, struct peer *peer, afi_t afi, diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index efb7f9eb7..657e022db 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -4042,13 +4042,11 @@ static void bgp_route_map_process_update_cb(char *rmap_name) vpn_policy_routemap_event(rmap_name); } -int bgp_route_map_update_timer(struct thread *thread) +void bgp_route_map_update_timer(struct thread *thread) { bm->t_rmap_update = NULL; route_map_walk_update_list(bgp_route_map_process_update_cb); - - return 0; } static void bgp_route_map_mark_update(const char *rmap_name) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index b320e4e71..5d1ae766e 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -357,7 +357,7 @@ static struct prefix *pfx_record_to_prefix(struct pfx_record *record) return prefix; } -static int bgpd_sync_callback(struct thread *thread) +static void bgpd_sync_callback(struct thread *thread) { struct bgp *bgp; struct listnode *node; @@ -375,13 +375,13 @@ static int bgpd_sync_callback(struct thread *thread) atomic_store_explicit(&rtr_update_overflow, 0, memory_order_seq_cst); revalidate_all_routes(); - return 0; + return; } retval = read(socket, &rec, sizeof(struct pfx_record)); if (retval != sizeof(struct pfx_record)) { RPKI_DEBUG("Could not read from socket"); - return retval; + return; } /* RTR-Server crashed/terminated, let's handle and switch @@ -389,7 +389,7 @@ static int bgpd_sync_callback(struct thread *thread) */ if (rec.socket && rec.socket->state == RTR_ERROR_FATAL) { reset(true); - return 0; + return; } prefix = pfx_record_to_prefix(&rec); @@ -421,7 +421,6 @@ static int bgpd_sync_callback(struct thread *thread) } prefix_free(&prefix); - return 0; } static void revalidate_bgp_node(struct bgp_dest *bgp_dest, afi_t afi, diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index bfcb4810d..aa3e44318 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -1157,7 +1157,7 @@ bool update_subgroup_check_merge(struct update_subgroup *subgrp, /* * update_subgroup_merge_check_thread_cb */ -static int update_subgroup_merge_check_thread_cb(struct thread *thread) +static void update_subgroup_merge_check_thread_cb(struct thread *thread) { struct update_subgroup *subgrp; @@ -1166,7 +1166,6 @@ static int update_subgroup_merge_check_thread_cb(struct thread *thread) subgrp->t_merge_check = NULL; update_subgroup_check_merge(subgrp, "triggered merge check"); - return 0; } /* @@ -1803,7 +1802,7 @@ update_group_default_originate_route_map_walkcb(struct update_group *updgrp, return UPDWALK_CONTINUE; } -int update_group_refresh_default_originate_route_map(struct thread *thread) +void update_group_refresh_default_originate_route_map(struct thread *thread) { struct bgp *bgp; char reason[] = "refresh default-originate route-map"; @@ -1813,8 +1812,6 @@ int update_group_refresh_default_originate_route_map(struct thread *thread) reason); thread_cancel(&bgp->t_rmap_def_originate_eval); bgp_unlock(bgp); - - return 0; } /* diff --git a/bgpd/bgp_updgrp.h b/bgpd/bgp_updgrp.h index 5a9bebf8f..0e10341bc 100644 --- a/bgpd/bgp_updgrp.h +++ b/bgpd/bgp_updgrp.h @@ -375,7 +375,7 @@ extern void update_group_af_walk(struct bgp *bgp, afi_t afi, safi_t safi, updgrp_walkcb cb, void *ctx); extern void update_group_walk(struct bgp *bgp, updgrp_walkcb cb, void *ctx); extern void update_group_periodic_merge(struct bgp *bgp); -extern int +extern void update_group_refresh_default_originate_route_map(struct thread *thread); extern void update_group_start_advtimer(struct bgp *bgp); diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 97b32643b..0d8ee79ae 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -316,7 +316,7 @@ static void updgrp_show_adj(struct bgp *bgp, afi_t afi, safi_t safi, update_group_af_walk(bgp, afi, safi, updgrp_show_adj_walkcb, &ctx); } -static int subgroup_coalesce_timer(struct thread *thread) +static void subgroup_coalesce_timer(struct thread *thread) { struct update_subgroup *subgrp; struct bgp *bgp; @@ -351,8 +351,6 @@ static int subgroup_coalesce_timer(struct thread *thread) BGP_TIMER_ON(peer->t_routeadv, bgp_routeadv_timer, 0); } } - - return 0; } static int update_group_announce_walkcb(struct update_group *updgrp, void *arg) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 6691dc56c..c295b0660 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1019,7 +1019,7 @@ static bool bgp_tm_chunk_obtained; static uint32_t bgp_tm_min, bgp_tm_max, bgp_tm_chunk_size; struct bgp *bgp_tm_bgp; -static int bgp_zebra_tm_connect(struct thread *t) +static void bgp_zebra_tm_connect(struct thread *t) { struct zclient *zclient; int delay = 10, ret = 0; @@ -1050,7 +1050,6 @@ static int bgp_zebra_tm_connect(struct thread *t) } thread_add_timer(bm->master, bgp_zebra_tm_connect, zclient, delay, &bgp_tm_thread_connect); - return 0; } bool bgp_zebra_tm_chunk_obtained(void) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 43046f7f1..16488eb4a 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3044,14 +3044,12 @@ int peer_group_bind(struct bgp *bgp, union sockunion *su, struct peer *peer, return 0; } -static int bgp_startup_timer_expire(struct thread *thread) +static void bgp_startup_timer_expire(struct thread *thread) { struct bgp *bgp; bgp = THREAD_ARG(thread); bgp->t_startup = NULL; - - return 0; } /* diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 8b93c450e..926b0b033 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -2226,7 +2226,7 @@ extern int peer_ttl_security_hops_unset(struct peer *); extern void peer_tx_shutdown_message_set(struct peer *, const char *msg); extern void peer_tx_shutdown_message_unset(struct peer *); -extern int bgp_route_map_update_timer(struct thread *thread); +extern void bgp_route_map_update_timer(struct thread *thread); extern void bgp_route_map_terminate(void); extern int peer_cmp(struct peer *p1, struct peer *p2); diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 1f60c6699..1d58c0331 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -2372,7 +2372,7 @@ static void rfapiMonitorEncapDelete(struct bgp_path_info *vpn_bpi) * quagga lib/thread.h says this must return int even though * it doesn't do anything with the return value */ -static int rfapiWithdrawTimerVPN(struct thread *t) +static void rfapiWithdrawTimerVPN(struct thread *t) { struct rfapi_withdraw *wcb = t->arg; struct bgp_path_info *bpi = wcb->info; @@ -2385,13 +2385,13 @@ static int rfapiWithdrawTimerVPN(struct thread *t) vnc_zlog_debug_verbose( "%s: NULL BGP pointer, assume shutdown race condition!!!", __func__); - return 0; + return; } if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS)) { vnc_zlog_debug_verbose( "%s: BGP delete in progress, assume shutdown race condition!!!", __func__); - return 0; + return; } assert(wcb->node); assert(bpi); @@ -2503,7 +2503,6 @@ done: RFAPI_CHECK_REFCOUNT(wcb->node, SAFI_MPLS_VPN, 1 + wcb->lockoffset); agg_unlock_node(wcb->node); /* decr ref count */ XFREE(MTYPE_RFAPI_WITHDRAW, wcb); - return 0; } /* @@ -2674,7 +2673,7 @@ rfapiWithdrawEncapUpdateCachedUn(struct rfapi_import_table *import_table, return 0; } -static int rfapiWithdrawTimerEncap(struct thread *t) +static void rfapiWithdrawTimerEncap(struct thread *t) { struct rfapi_withdraw *wcb = t->arg; struct bgp_path_info *bpi = wcb->info; @@ -2748,7 +2747,6 @@ done: agg_unlock_node(wcb->node); /* decr ref count */ XFREE(MTYPE_RFAPI_WITHDRAW, wcb); skiplist_free(vpn_node_sl); - return 0; } @@ -2760,7 +2758,7 @@ static void rfapiBiStartWithdrawTimer(struct rfapi_import_table *import_table, struct agg_node *rn, struct bgp_path_info *bpi, afi_t afi, safi_t safi, - int (*timer_service_func)(struct thread *)) + void (*timer_service_func)(struct thread *)) { uint32_t lifetime; struct rfapi_withdraw *wcb; @@ -4062,7 +4060,7 @@ static void rfapiProcessPeerDownRt(struct peer *peer, struct agg_node *rn; struct bgp_path_info *bpi; struct agg_table *rt; - int (*timer_service_func)(struct thread *); + void (*timer_service_func)(struct thread *); assert(afi == AFI_IP || afi == AFI_IP6); diff --git a/bgpd/rfapi/rfapi_import.h b/bgpd/rfapi/rfapi_import.h index 50093111c..387e6c47c 100644 --- a/bgpd/rfapi/rfapi_import.h +++ b/bgpd/rfapi/rfapi_import.h @@ -126,8 +126,6 @@ extern void rfapiCheckRefcount(struct agg_node *rn, safi_t safi, extern int rfapiHasNonRemovedRoutes(struct agg_node *rn); -extern int rfapiProcessDeferredClose(struct thread *t); - extern int rfapiGetUnAddrOfVpnBi(struct bgp_path_info *bpi, struct prefix *p); extern void rfapiNexthop2Prefix(struct attr *attr, struct prefix *p); diff --git a/bgpd/rfapi/rfapi_monitor.c b/bgpd/rfapi/rfapi_monitor.c index ce916c104..58a0f8dea 100644 --- a/bgpd/rfapi/rfapi_monitor.c +++ b/bgpd/rfapi/rfapi_monitor.c @@ -731,7 +731,7 @@ void rfapiMonitorResponseRemovalOn(struct bgp *bgp) bgp->rfapi_cfg->flags &= ~BGP_VNC_CONFIG_RESPONSE_REMOVAL_DISABLE; } -static int rfapiMonitorTimerExpire(struct thread *t) +static void rfapiMonitorTimerExpire(struct thread *t) { struct rfapi_monitor_vpn *m = t->arg; @@ -740,8 +740,6 @@ static int rfapiMonitorTimerExpire(struct thread *t) /* delete the monitor */ rfapiMonitorDel(bgp_get_default(), m->rfd, &m->p); - - return 0; } static void rfapiMonitorTimerRestart(struct rfapi_monitor_vpn *m) @@ -1041,7 +1039,7 @@ void rfapiMonitorMovedUp(struct rfapi_import_table *import_table, } } -static int rfapiMonitorEthTimerExpire(struct thread *t) +static void rfapiMonitorEthTimerExpire(struct thread *t) { struct rfapi_monitor_eth *m = t->arg; @@ -1052,7 +1050,6 @@ static int rfapiMonitorEthTimerExpire(struct thread *t) rfapiMonitorEthDel(bgp_get_default(), m->rfd, &m->macaddr, m->logical_net_id); - return 0; } static void rfapiMonitorEthTimerRestart(struct rfapi_monitor_eth *m) diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index 6f555d368..ba0c576f1 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -291,7 +291,7 @@ struct rfapi_rib_tcb { /* * remove route from rib */ -static int rfapiRibExpireTimer(struct thread *t) +static void rfapiRibExpireTimer(struct thread *t) { struct rfapi_rib_tcb *tcb = t->arg; @@ -328,8 +328,6 @@ static int rfapiRibExpireTimer(struct thread *t) XFREE(MTYPE_RFAPI_RECENT_DELETE, tcb); RFAPI_RIB_CHECK_COUNTS(1, 0); - - return 0; } static void rfapiRibStartTimer(struct rfapi_descriptor *rfd, diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c index 67c43a867..f4f2e1139 100644 --- a/bgpd/rfapi/vnc_export_bgp.c +++ b/bgpd/rfapi/vnc_export_bgp.c @@ -1728,7 +1728,7 @@ void vnc_direct_bgp_rh_add_route(struct bgp *bgp, afi_t afi, bgp_attr_unintern(&iattr); } -static int vncExportWithdrawTimer(struct thread *t) +static void vncExportWithdrawTimer(struct thread *t) { struct vnc_export_info *eti = t->arg; const struct prefix *p = agg_node_get_prefix(eti->node); @@ -1747,8 +1747,6 @@ static int vncExportWithdrawTimer(struct thread *t) * Free the eti */ vnc_eti_delete(eti); - - return 0; } /* |