From ab5622291474c5b5325927aafc0ee4aeb7c23846 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 13 Jun 2023 16:01:40 +0300 Subject: [PATCH] bgpd: Use enum bgp_fsm_state_progress for bgp_stop() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ``` bgpd/bgp_fsm.c:1360:29: warning: conflicting types for ‘bgp_stop’ due to enum/integer mismatch; have ‘enum bgp_fsm_state_progress(struct peer *)’ [-Wenum-int-mismatch] 1360 | enum bgp_fsm_state_progress bgp_stop(struct peer *peer) | ^~~~~~~~ In file included from bgpd/bgp_fsm.c:29: ./bgpd/bgp_fsm.h:111:12: note: previous declaration of ‘bgp_stop’ with type ‘int(struct peer *)’ 111 | extern int bgp_stop(struct peer *peer); | ^~~~~~~~ ``` Signed-off-by: Donatas Abraitis (cherry picked from commit 58a92cb81084e33dcb291b7fef09eddccb7cef81) --- bgpd/bgp_fsm.c | 7 ------- bgpd/bgp_fsm.h | 9 ++++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index d93ab1d252..af2ef4c839 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -46,13 +46,6 @@ DEFINE_HOOK(peer_backward_transition, (struct peer * peer), (peer)); DEFINE_HOOK(peer_status_changed, (struct peer * peer), (peer)); -enum bgp_fsm_state_progress { - BGP_FSM_FAILURE_AND_DELETE = -2, - BGP_FSM_FAILURE = -1, - BGP_FSM_SUCCESS = 0, - BGP_FSM_SUCCESS_STATE_TRANSFER = 1, -}; - /* Definition of display strings corresponding to FSM events. This should be * kept consistent with the events defined in bgpd.h */ diff --git a/bgpd/bgp_fsm.h b/bgpd/bgp_fsm.h index dce4773672..83ccf68d0a 100644 --- a/bgpd/bgp_fsm.h +++ b/bgpd/bgp_fsm.h @@ -7,6 +7,13 @@ #ifndef _QUAGGA_BGP_FSM_H #define _QUAGGA_BGP_FSM_H +enum bgp_fsm_state_progress { + BGP_FSM_FAILURE_AND_DELETE = -2, + BGP_FSM_FAILURE = -1, + BGP_FSM_SUCCESS = 0, + BGP_FSM_SUCCESS_STATE_TRANSFER = 1, +}; + /* Macro for BGP read, write and timer thread. */ #define BGP_TIMER_ON(T, F, V) \ do { \ @@ -108,7 +115,7 @@ extern void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops); extern void bgp_event(struct event *event); extern int bgp_event_update(struct peer *, enum bgp_fsm_events event); -extern int bgp_stop(struct peer *peer); +extern enum bgp_fsm_state_progress bgp_stop(struct peer *peer); extern void bgp_timer_set(struct peer *); extern void bgp_routeadv_timer(struct event *event); extern void bgp_fsm_change_status(struct peer *peer, -- 2.39.5