aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Streejak <oleg@pcbtech.ru>2025-07-17 17:06:50 +0000
committerKyle Evans <kevans@FreeBSD.org>2025-07-21 02:13:16 +0000
commitdd695839efd80fe81143cd6c7a552c30df8448f6 (patch)
tree6d8a356df6335df574e6f8e47c9f5be63b264dda
parent34f71ebee8bd73d6d7bf56aaddf4aeffd754c8d0 (diff)
route: fix `route -n monitor` when its output is redirected
This is a small oversight in the transition to netlink; the non-netlink implementation would explicitly flush its stdout as necessary to avoid apparent long stalls in output when we end up fully-buffered. Adjust the netlink implementation to do the same. This was noticed while trying to triage failures in the wg-quick script. Commit message by kevans, patch by author. PR: 278265 Fixes: 091fec1188929 ("route: switch transport protocol [...]") (cherry picked from commit 97b61b22edba74c62adba1d022fb73541aa5ff93)
-rw-r--r--sbin/route/route_netlink.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c
index 28766b062e18..2870d256aadd 100644
--- a/sbin/route/route_netlink.c
+++ b/sbin/route/route_netlink.c
@@ -733,6 +733,7 @@ print_nlmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct snl_msg_info *cinf
print_nlmsg_generic(h, hdr, cinfo);
}
+ fflush(stdout);
snl_clear_lb(&h->ss_cmd);
}