diff options
author | Chris Hall <GMCH@hestia.halldom.com> | 2010-09-10 17:52:17 +0100 |
---|---|---|
committer | Chris Hall <GMCH@hestia.halldom.com> | 2010-09-10 17:52:17 +0100 |
commit | 0cadbd1f2cb40f8fb46c0fcc1e1732dc4c519850 (patch) | |
tree | 04b1bf260e699fe6290d44ff2f7dc1f691042a1c /bgpd/bgp_connection.h | |
parent | 5742d229c2dfe86e626cf9287f99ff7f10673c34 (diff) | |
download | quagga-ex07.tar.bz2 quagga-ex07.tar.xz |
Fix bug in NOTIFICATION handling before FSM reaches Established state.ex07
Change removes the setting of session->active to false which was being
done before a NOTIFICATION message is sent. This flag should remain
true when the session is not being stopped -- which is the case if
a NOTIFICATION is sent before Established state is reached.
Effect of this bug was to trip up the accept() side of the session,
bringing bgpd down on an assert().
This bug may be triggered by a peer that accepts a connection and then
remains silent, for whatever reason -- causing bgpd to issue an
HoldTimer Expired NOTIFICATION.
Version advanced to 0.99.15ex07.
Other changes purely cosmetic -- eg changing some 'int' to 'bool',
and a few small documentation edits.
Diffstat (limited to 'bgpd/bgp_connection.h')
-rw-r--r-- | bgpd/bgp_connection.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bgpd/bgp_connection.h b/bgpd/bgp_connection.h index 9e7d4086..304724cd 100644 --- a/bgpd/bgp_connection.h +++ b/bgpd/bgp_connection.h @@ -237,10 +237,10 @@ bgp_connection_make_primary(bgp_connection connection) ; extern void bgp_connection_full_close(bgp_connection connection, int unset_timers) ; -#define bgp_connection_close(conn) bgp_connection_full_close(conn, 0) -#define bgp_connection_close_down(conn) bgp_connection_full_close(conn, 1) +#define bgp_connection_close(conn) bgp_connection_full_close(conn, false) +#define bgp_connection_close_down(conn) bgp_connection_full_close(conn, true) -extern int +extern bool bgp_connection_part_close(bgp_connection connection) ; extern void @@ -261,7 +261,7 @@ bgp_connection_queue_del(bgp_connection connection) ; extern int bgp_connection_queue_process(void) ; -Inline int +Inline bool bgp_connection_no_pending(bgp_connection connection, bgp_connection* is_pending) { return ( (mqueue_local_head(&connection->pending_queue) == NULL) @@ -296,7 +296,7 @@ bgp_write_buffer_reset(bgp_wbuffer wb) * * NB: there is never any room in an unallocated buffer. */ -Inline int +Inline bool bgp_write_buffer_cannot(bgp_wbuffer wb, size_t want) { return ((size_t)(wb->limit - wb->p_in) <= want) ; @@ -309,7 +309,7 @@ bgp_write_buffer_cannot(bgp_wbuffer wb, size_t want) */ enum { bgp_write_buffer_full_threshold = BGP_MSG_MAX_L + 1 } ; -Inline int +Inline bool bgp_write_buffer_cannot_max(bgp_wbuffer wb) { return bgp_write_buffer_cannot(wb, BGP_MSG_MAX_L) ; @@ -321,11 +321,11 @@ bgp_write_buffer_cannot_max(bgp_wbuffer wb) * If empty, ensures that the buffer has been allocated, and sets the pointers * to the start of the buffer -- so all set to go. */ -Inline int +Inline bool bgp_write_buffer_empty(bgp_wbuffer wb) { if (wb->p_out < wb->p_in) - return 0 ; /* not empty => has buffer */ + return false ; /* not empty => has buffer */ dassert(wb->p_out == wb->p_in) ; @@ -333,7 +333,7 @@ bgp_write_buffer_empty(bgp_wbuffer wb) bgp_write_buffer_reset(wb) ; /* pointers to start of buffer */ - return 1 ; /* empty and all ready to go */ + return true ; /* empty and all ready to go */ } ; /*------------------------------------------------------------------------------ @@ -344,7 +344,7 @@ bgp_write_buffer_empty(bgp_wbuffer wb) * > 0 => allocated. */ Inline int -bgp_write_buffer_pending(bgp_wbuffer wb) +bgp_write_buffer_has(bgp_wbuffer wb) { dassert(wb->p_out <= wb->p_in) ; return (wb->p_in - wb->p_out) ; @@ -353,7 +353,7 @@ bgp_write_buffer_pending(bgp_wbuffer wb) /*------------------------------------------------------------------------------ * As above, for connection */ -Inline int +Inline bool bgp_connection_write_cannot_max(bgp_connection connection) { return bgp_write_buffer_cannot_max(&connection->wbuff) ; @@ -362,7 +362,7 @@ bgp_connection_write_cannot_max(bgp_connection connection) /*------------------------------------------------------------------------------ * As above, for connection */ -Inline int +Inline bool bgp_connection_write_empty(bgp_connection connection) { return bgp_write_buffer_empty(&connection->wbuff) ; |