* (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#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))
if (str2sockunion(buf,
&sactx->local.host)
< 0)
- zlog_err(
+ flog_err(
+ EC_NHRP_SWAN,
"VICI: bad strongSwan local-host: %s",
buf);
} else if (blob_equal(key, "local-id")
if (str2sockunion(buf,
&sactx->remote.host)
< 0)
- zlog_err(
+ flog_err(
+ EC_NHRP_SWAN,
"VICI: bad strongSwan remote-host: %s",
buf);
} else if (blob_equal(key, "remote-id")
case VICI_KEY_VALUE:
if (blob_equal(key, "errmsg")
&& blob2buf(val, buf, sizeof(buf)))
- zlog_err("VICI: strongSwan: %s", buf);
+ flog_err(EC_NHRP_SWAN, "VICI: strongSwan: %s", buf);
break;
default:
break;
uint32_t msglen;
uint8_t msgtype;
struct blob name;
- struct vici_message_ctx ctx;
+ struct vici_message_ctx ctx = { .nsections = 0 };
msglen = zbuf_get_be32(msg);
msgtype = zbuf_get8(msg);
break;
case VICI_EVENT_UNKNOWN:
case VICI_CMD_UNKNOWN:
- zlog_err(
+ flog_err(
+ EC_NHRP_SWAN,
"VICI: StrongSwan does not support mandatory events (unpatched?)");
break;
case VICI_EVENT_CONFIRM: