diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-18 15:25:03 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-08-14 22:02:05 +0200 |
commit | 357743576d39f756849cd01e4fdd23f350a89370 (patch) | |
tree | 4d66107e31518ba77cbdfcad0e44b62ac63e06fb /lib | |
parent | lib: Add LIB_ERR_DEVELOPMENT (diff) | |
download | frr-357743576d39f756849cd01e4fdd23f350a89370.tar.xz frr-357743576d39f756849cd01e4fdd23f350a89370.zip |
lib: Add LIB_ERR_ZMQ
Add new error event for when we detect an issue within
the ZMQ subsystem.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/frr_zmq.c | 7 | ||||
-rw-r--r-- | lib/lib_errors.c | 6 | ||||
-rw-r--r-- | lib/lib_errors.h | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/lib/frr_zmq.c b/lib/frr_zmq.c index 3153e697f..c479543ce 100644 --- a/lib/frr_zmq.c +++ b/lib/frr_zmq.c @@ -24,6 +24,7 @@ #include "memory.h" #include "frr_zmq.h" #include "log.h" +#include "lib_errors.h" DEFINE_MTYPE_STATIC(LIB, ZEROMQ_CB, "ZeroMQ callback") @@ -140,7 +141,8 @@ static int frrzmq_read_msg(struct thread *t) return 0; out_err: - zlog_err("ZeroMQ read error: %s(%d)", strerror(errno), errno); + zlog_ferr(LIB_ERR_ZMQ, "ZeroMQ read error: %s(%d)", strerror(errno), + errno); if (cb->read.cb_error) cb->read.cb_error(cb->read.arg, cb->zmqsock); return 1; @@ -253,7 +255,8 @@ static int frrzmq_write_msg(struct thread *t) return 0; out_err: - zlog_err("ZeroMQ write error: %s(%d)", strerror(errno), errno); + zlog_ferr(LIB_ERR_ZMQ, "ZeroMQ write error: %s(%d)", strerror(errno), + errno); if (cb->write.cb_error) cb->write.cb_error(cb->write.arg, cb->zmqsock); return 1; diff --git a/lib/lib_errors.c b/lib/lib_errors.c index ae4635673..d45e21ddc 100644 --- a/lib/lib_errors.c +++ b/lib/lib_errors.c @@ -95,6 +95,12 @@ static struct ferr_ref ferr_lib_err[] = { .suggestion = "Open an Issue with all relevant log files" }, { + .code = LIB_ERR_ZMQ, + .title = "ZMQ Subsystem Error", + .description = "FRR has detected an issue with the Zero MQ subsystem and ZeroMQ\nis not working properly now", + .suggestion = "Open an Issue with all relevant log files and restart FRR" + }, + { .code = END_FERR, } }; diff --git a/lib/lib_errors.h b/lib/lib_errors.h index bb83c45e6..5a68efb30 100644 --- a/lib/lib_errors.h +++ b/lib/lib_errors.h @@ -35,6 +35,7 @@ enum lib_ferr_refs { LIB_ERR_INTERFACE, LIB_ERR_NS, LIB_ERR_DEVELOPMENT, + LIB_ERR_ZMQ, }; extern void lib_error_init(void); |