From 37836fc83ef0734fe470532e2967af7dc37960a0 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 100135341c..8c36c5066b 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -61,13 +61,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 5c58188b7a..90781aca82 100644 --- a/bgpd/bgp_fsm.h +++ b/bgpd/bgp_fsm.h @@ -22,6 +22,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 { \ @@ -122,7 +129,7 @@ extern void bgp_fsm_nht_update(struct peer *peer, bool has_valid_nexthops); 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 enum bgp_fsm_state_progress bgp_stop(struct peer *peer); extern void bgp_timer_set(struct peer *); extern void bgp_routeadv_timer(struct thread *); extern void bgp_fsm_change_status(struct peer *peer, -- 2.39.5