]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Add LIB_ERR_ZMQ
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 18 Jun 2018 13:25:03 +0000 (09:25 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 14 Aug 2018 20:02:05 +0000 (20:02 +0000)
Add new error event for when we detect an issue within
the ZMQ subsystem.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/frr_zmq.c
lib/lib_errors.c
lib/lib_errors.h

index 3153e697faaa03f4ca29af82baf6726211ae75ae..c479543ce4a37894e7586d96d6cd5da902c2b241 100644 (file)
@@ -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;
index ae4635673f26c81a2012df0abc70aa8ea603f2de..d45e21ddc8b20b1bfdbc0c04466c71d69c8760fe 100644 (file)
@@ -94,6 +94,12 @@ static struct ferr_ref ferr_lib_err[] = {
                .description = "FRR has detected an issue where new development has not properly\nupdated all code paths.",
                .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,
        }
index bb83c45e67d7abf8630622edb3c95b9857feb4f9..5a68efb30c765e8ca05861e9a8ec83a30d336ff6 100644 (file)
@@ -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);