From 5f004539b83db92520903b601d1717a2b702ba50 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Sat, 5 Dec 2020 21:44:41 -0300 Subject: [PATCH] ldpd: fix printfrr format specifiers in the child processes 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 --- ldpd/log.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ldpd/log.c b/ldpd/log.c index 1903017588..1aaad41a10 100644 --- a/ldpd/log.c +++ b/ldpd/log.c @@ -22,6 +22,7 @@ #include "ldpe.h" #include "lde.h" #include "log.h" +#include "printfrr.h" #include @@ -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; -- 2.39.5