Skip to contentSkip to conversation

ss: force a flush in monitor mode

PATCH Applied Eric Dumazet 2 participants 2 messages Apr 15

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ss: force a flush in monitor mode

Call fflush() from generic_show_sock() in order to work with pipes and redirects.

After this patch, "ss -E &>log_file" works as expected.

---
 misc/ss.c | 1 +
 1 file changed, 1 insertion(+)
misc/ss.c +1 -0
index 1ea804ad549e23f767633e07efdd9adf1277af18..39b109276ffa83f12d1e1e9f8f2cf58c25737b4b 100644
@@ -5534,6 +5534,7 @@ static int generic_show_sock(struct nlmsghdr *nlh, void *arg)
 
 	render();
 
+	fflush(stdout);
 	return ret;
 }
 
Signature · 1 line
2.54.0.rc1.513.gad8abe7a5a-goog
#1 lore raw
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:

Quoted 8 lines · On Wed, 15 Apr 2026 13:03:07 +0000 you wrote:

Call fflush() from generic_show_sock() in order to work with pipes and redirects.

After this patch, "ss -E &>log_file" works as expected.

[...]

Here is the summary with links:
- [iproute2] ss: force a flush in monitor mode

    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=4d82739fda71

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html