]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/log.c
lib: STAILQ_FOREACH_SAFE never gives a null elem
[mirror_frr.git] / lib / log.c
index 12a1d7fbe04062a1c8ae24863c568a8ea00b2878..c424a5bc98ae1d31df7cc6563af701cbbeec8308 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -29,6 +29,7 @@
 #include "memory.h"
 #include "command.h"
 #include "lib_errors.h"
+#include "lib/hook.h"
 
 #ifndef SUNOS_5
 #include <sys/un.h>
 
 DEFINE_MTYPE_STATIC(LIB, ZLOG, "Logging")
 
+/* hook for external logging */
+DEFINE_HOOK(zebra_ext_log, (int priority, const char *format, va_list args),
+           (priority, format, args));
+
 static int logfile_fd = -1; /* Used in signal handler. */
 
 struct zlog *zlog_default = NULL;
@@ -213,6 +218,9 @@ void vzlog(int priority, const char *format, va_list args)
        tsctl.already_rendered = 0;
        struct zlog *zl = zlog_default;
 
+       /* call external hook */
+       hook_call(zebra_ext_log, priority, format, args);
+
        /* When zlog_default is also NULL, use stderr for logging. */
        if (zl == NULL) {
                tsctl.precision = 0;
@@ -1019,6 +1027,7 @@ static const struct zebra_desc_table command_types[] = {
        DESC_ENTRY(ZEBRA_RELEASE_LABEL_CHUNK),
        DESC_ENTRY(ZEBRA_ADVERTISE_ALL_VNI),
        DESC_ENTRY(ZEBRA_ADVERTISE_DEFAULT_GW),
+       DESC_ENTRY(ZEBRA_ADVERTISE_SVI_MACIP),
        DESC_ENTRY(ZEBRA_ADVERTISE_SUBNET),
        DESC_ENTRY(ZEBRA_LOCAL_ES_ADD),
        DESC_ENTRY(ZEBRA_LOCAL_ES_DEL),