]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Use enum bgp_fsm_state_progress for bgp_stop()
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 13 Jun 2023 13:01:40 +0000 (16:01 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 30 May 2024 15:15:50 +0000 (15:15 +0000)
```
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 <donatas@opensourcerouting.org>
(cherry picked from commit 58a92cb81084e33dcb291b7fef09eddccb7cef81)

bgpd/bgp_fsm.c
bgpd/bgp_fsm.h

index 100135341ca7f25d0319e2d3540c83c173760d47..8c36c5066bdcd2803d6ebc96b228507528a2530d 100644 (file)
 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
  */
index 5c58188b7a2778cb500bb35c5a496b6d9e7394fe..90781aca828cb3b590dadef0add10b66d615ddc1 100644 (file)
 #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 {                                                                   \
 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,