summaryrefslogtreecommitdiff
path: root/nhrpd/vici.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-19 15:28:01 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 20:02:05 +0000
commitaed070112489e92dbdcc4eb02243aec8af2d66af (patch)
tree3f9be78c9061266899d1025bd2098ebd8bc0ebe9 /nhrpd/vici.c
parent4f3be6672ffa8fde728dc7f80810187088b8315c (diff)
nhrpd: Add NHRP_ERR_XXXX for zlog_err to zlog_ferr conversion
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'nhrpd/vici.c')
-rw-r--r--nhrpd/vici.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/nhrpd/vici.c b/nhrpd/vici.c
index eb3827a12f..dae29e535a 100644
--- a/nhrpd/vici.c
+++ b/nhrpd/vici.c
@@ -14,9 +14,11 @@
#include "thread.h"
#include "zbuf.h"
#include "log.h"
-#include "nhrpd.h"
+#include "lib_errors.h"
+#include "nhrpd.h"
#include "vici.h"
+#include "nhrp_errors.h"
#define ERRNO_IO_RETRY(EN) (((EN) == EAGAIN) || ((EN) == EWOULDBLOCK) || ((EN) == EINTR))
@@ -212,9 +214,9 @@ static void parse_sa_message(struct vici_message_ctx *ctx,
if (str2sockunion(buf,
&sactx->local.host)
< 0)
- zlog_err(
- "VICI: bad strongSwan local-host: %s",
- buf);
+ zlog_ferr(NHRP_ERR_SWAN,
+ "VICI: bad strongSwan local-host: %s",
+ buf);
} else if (blob_equal(key, "local-id")
&& ctx->nsections == 1) {
sactx->local.id = *val;
@@ -230,9 +232,9 @@ static void parse_sa_message(struct vici_message_ctx *ctx,
if (str2sockunion(buf,
&sactx->remote.host)
< 0)
- zlog_err(
- "VICI: bad strongSwan remote-host: %s",
- buf);
+ zlog_ferr(NHRP_ERR_SWAN,
+ "VICI: bad strongSwan remote-host: %s",
+ buf);
} else if (blob_equal(key, "remote-id")
&& ctx->nsections == 1) {
sactx->remote.id = *val;
@@ -275,7 +277,7 @@ static void parse_cmd_response(struct vici_message_ctx *ctx,
case VICI_KEY_VALUE:
if (blob_equal(key, "errmsg")
&& blob2buf(val, buf, sizeof(buf)))
- zlog_err("VICI: strongSwan: %s", buf);
+ zlog_ferr(NHRP_ERR_SWAN, "VICI: strongSwan: %s", buf);
break;
default:
break;
@@ -334,7 +336,7 @@ static void vici_recv_message(struct vici_conn *vici, struct zbuf *msg)
break;
case VICI_EVENT_UNKNOWN:
case VICI_CMD_UNKNOWN:
- zlog_err(
+ zlog_ferr(NHRP_ERR_SWAN,
"VICI: StrongSwan does not support mandatory events (unpatched?)");
break;
case VICI_EVENT_CONFIRM: