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 *);
/* 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;
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);
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;
*/
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;
/* 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;
THREAD_VAL(thread) = DelayOpen_timer_expired;
bgp_event(thread); /* bgp_event unlocks peer */
-
- return 0;
}
/* BGP Peer Down Cause */
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;
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)
}
}
-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;
}
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;
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;
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)
}
/* 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;
bgp->maxmed_onstartup_over = 1;
bgp_maxmed_update(bgp);
-
- return 0;
}
static void bgp_maxmed_onstartup_begin(struct bgp *bgp)
}
/* 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;
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;
bgp = THREAD_ARG(thread);
THREAD_OFF(bgp->t_establish_wait);
bgp_check_update_delay(bgp);
-
- return 0;
}
/* Steps to begin the update delay:
* 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;
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. */
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;
}
}
};
/* 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)