]> git.puffer.fish Git - mirror/frr.git/commitdiff
ldpd: fix printfrr format specifiers in the child processes 7699/head
authorRenato Westphal <renato@opensourcerouting.org>
Sun, 6 Dec 2020 00:44:41 +0000 (21:44 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 9 Dec 2020 14:55:10 +0000 (11:55 -0300)
In ldpd, the child processes send IPC messages to the main process to
perform logging in their behalf (access to the file descriptor used
for logging needs to be serialized). This commit fixes a problem
that was preventing the printfrr format specifiers from working in
the child processes, since vsnprintf() was being used instead of
vsnprintfrr() before sending the log messages to the parent process.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/log.c

index 19030175884e94479e26863a83e5463723274404..1aaad41a10edf48fb4d7f4c82d6691ca016a13c8 100644 (file)
@@ -22,6 +22,7 @@
 #include "ldpe.h"
 #include "lde.h"
 #include "log.h"
+#include "printfrr.h"
 
 #include <lib/log.h>
 
@@ -44,12 +45,12 @@ vlog(int pri, const char *fmt, va_list ap)
 
        switch (ldpd_process) {
        case PROC_LDE_ENGINE:
-               vsnprintf(buf, sizeof(buf), fmt, ap);
+               vsnprintfrr(buf, sizeof(buf), fmt, ap);
                lde_imsg_compose_parent_sync(IMSG_LOG, pri, buf,
                    strlen(buf) + 1);
                break;
        case PROC_LDP_ENGINE:
-               vsnprintf(buf, sizeof(buf), fmt, ap);
+               vsnprintfrr(buf, sizeof(buf), fmt, ap);
                ldpe_imsg_compose_parent_sync(IMSG_LOG, pri, buf,
                    strlen(buf) + 1);
                break;