summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_fsm.c
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-04-08 19:51:10 +0100
committerChris Hall <GMCH@hestia.halldom.com>2010-04-08 19:51:10 +0100
commit83447a051fbcc88b33fcea6670520687668d3ba1 (patch)
treef3be10368d9fc6c605c1ec351bc7c1f2c0c61ff0 /bgpd/bgp_fsm.c
parent17b711e6e4a4d5ce3728a07890434d890ebb76b4 (diff)
downloadquagga-83447a051fbcc88b33fcea6670520687668d3ba1.tar.bz2
quagga-83447a051fbcc88b33fcea6670520687668d3ba1.tar.xz
New functions for error numbers and addresses in messages.
Implemented less onerous ways of including descriptions of errors and IP addresses in logging and other messages. Implemented mapping of error numbers to error names, which is generally more meaningful.
Diffstat (limited to 'bgpd/bgp_fsm.c')
-rw-r--r--bgpd/bgp_fsm.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 87e13ecb..9c323ffd 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -594,7 +594,7 @@ extern void
bgp_fsm_io_fatal_error(bgp_connection connection, int err)
{
plog_err (connection->log, "%s [Error] bgp IO error: %s",
- connection->host, safe_strerror(err)) ;
+ connection->host, errtoa(err, 0).str) ;
assert(err != EFAULT) ;
@@ -639,7 +639,7 @@ bgp_fsm_io_error(bgp_connection connection, int err)
plog_debug(connection->log,
"%s [Event] BGP connection closed fd %d (%s)",
connection->host, qps_file_fd(connection->qf),
- safe_strerror(err)) ;
+ errtoa(err, 0).str) ;
} ;
bgp_fsm_throw(connection, bgp_session_eTCP_dropped, NULL, err,
@@ -1711,21 +1711,19 @@ static bgp_fsm_action(bgp_fsm_accept)
*/
static bgp_fsm_action(bgp_fsm_send_open)
{
- char buf_l[SU_ADDRSTRLEN] ;
- char buf_r[SU_ADDRSTRLEN] ;
- const char* how ;
-
if (BGP_DEBUG (normal, NORMAL))
{
+ const char* how ;
+
if (connection->ordinal == bgp_connection_primary)
how = "connect" ;
else
how = "accept" ;
zlog_debug("%s open %s(), local address %s",
- sockunion2str(connection->su_remote, buf_r, sizeof(buf_r)),
- how,
- sockunion2str(connection->su_local, buf_l, sizeof(buf_l))) ;
+ sutoa(connection->su_remote).str,
+ how,
+ sutoa(connection->su_local).str) ;
} ;
bgp_connection_read_enable(connection) ;