From: Andrea Claudi Date: Thu, 12 Mar 2026 18:35:47 +0000 (+0100) Subject: dpll: Fix missing notifications in monitor mode X-Git-Tag: v7.0.0~4 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=4942e67f71f2df8e45eff723af114644b0eb9894;p=thirdparty%2Fiproute2.git dpll: Fix missing notifications in monitor mode When running dpll monitor with output redirected to a file, notifications could be lost because stdout is fully buffered for file redirection instead of line-buffered like in interactive mode. If the program is killed or crashes, buffered data is lost before reaching the file. Fix by calling fflush(stdout) after each notification to ensure immediate writes to the log file. Fixes: 656cfc3ce05b ("dpll: Add dpll command") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- diff --git a/dpll/dpll.c b/dpll/dpll.c index 0effa5a9..7b05bf86 100644 --- a/dpll/dpll.c +++ b/dpll/dpll.c @@ -1883,6 +1883,7 @@ static int cmd_monitor_cb(const struct nlmsghdr *nlh, void *data) break; } + fflush(stdout); return ret; }