summaryrefslogtreecommitdiffstats
path: root/lib/vty_io_vtysh.c
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2012-06-08 15:01:11 +0100
committerChris Hall <chris.hall@highwayman.com>2012-06-08 15:01:11 +0100
commit58b4a3411f12d3ef34ef52ab197729887074f321 (patch)
treee456eec427d977e2e723039b83d614d13edcf983 /lib/vty_io_vtysh.c
parent12d01b8b9c68f5dc72f2accdb29a760feb31420a (diff)
downloadquagga-ex25b.tar.bz2
quagga-ex25b.tar.xz
Fix bugs in vty error handlingex25b
Advance version to 0.99.20ex25b. Bug fixes: * when closing a vty, if close() returned an error, the vtys would fall into a loop trying to recover. This was found on FreeBSD, which will return ECONNRESET on close(), which is not standard POSIX behaviour. * when closing a vty in response to EPIPE or ECONNRESET, managed to leave the vty mutex locked. This stopped the Routing Engine *dead* on the next CLI command that required the Routing Engine. SIGTERM/SIGINT would not stop bgpd -- a SIGKILL would be required. Other changes: * toned down the error reporting of EPIPE in the vty -- so no longer looks like an error... ...closing a vty by "exit" command is logged as "closed" ...closing a vty in response to the client closing their end of the connection is logged as "terminated: terminal closed", and no longer logs an EPIPE error. * changed error reporting on close() and shutdown() for vty, so that nothing is logged if an i/o error has already logged... ...so that redundant error messages are suppressed. * applied slightly finer jittering to bgpd timers. * work in progress on new vtysh.
Diffstat (limited to 'lib/vty_io_vtysh.c')
-rw-r--r--lib/vty_io_vtysh.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/vty_io_vtysh.c b/lib/vty_io_vtysh.c
index f506eaa3..321ee6aa 100644
--- a/lib/vty_io_vtysh.c
+++ b/lib/vty_io_vtysh.c
@@ -258,17 +258,16 @@ uty_sh_serv_write_close(vio_vf vf)
if (vio->state & vst_final)
{
- const char* reason, * sep ;
+ const char* reason ;
XFREE(MTYPE_VTY_CLI, vf->vtysh) ;
reason = qs_string(vf->vio->close_reason) ;
- sep = ": " ;
if ((reason == NULL) || (*reason == '\0'))
- reason = sep = "" ;
+ reason = "closed" ;
- zlog_info("vtysh connection '%s' (fd %d) closed%s%s", vf->name,
- vio_vfd_fd(vf->vfd), sep, reason) ;
+ zlog_info("vtysh connection '%s' (fd %d) %s", vf->name,
+ vio_vfd_fd(vf->vfd), reason) ;
}
else if (vf_active(vf->vout_state))
{