]> git.ipfire.org Git - thirdparty/iproute2.git/commit
libnetlink: flush stdout only in monitor mode main
authorStephen Hemminger <stephen@networkplumber.org>
Mon, 27 Apr 2026 16:26:58 +0000 (09:26 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 27 Apr 2026 18:39:56 +0000 (11:39 -0700)
commitb468824a278648ce384f39a4bb1c9dd45a9b3772
tree5eab513d41b26b689bd5d5578d4d2c259c1f7464
parentf46186fd0332640cb09f719627e5e14d38d54472
libnetlink: flush stdout only in monitor mode

As Eric pointed out, fflush() only makes sense in monitor mode.
In other modes buffering the output helps with large outputs
like route dumps.

Move the fflush() into rtnl_listen() which is the common code
used by all monitoring subcommands. This also ensures any future
monitor subcommand gets correct flushing behavior automatically.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
35 files changed:
bridge/fdb.c
bridge/link.c
bridge/mdb.c
bridge/mst.c
bridge/vlan.c
bridge/vni.c
genl/ctrl.c
ip/ipaddress.c
ip/ipfou.c
ip/ipila.c
ip/ipioam6.c
ip/ipl2tp.c
ip/iplink.c
ip/ipmptcp.c
ip/ipmroute.c
ip/ipneigh.c
ip/ipnetconf.c
ip/ipnetns.c
ip/ipnexthop.c
ip/ipntable.c
ip/ipprefix.c
ip/iproute.c
ip/iprule.c
ip/ipseg6.c
ip/ipstats.c
ip/iptoken.c
ip/iptuntap.c
ip/tcp_metrics.c
ip/xfrm_monitor.c
ip/xfrm_policy.c
ip/xfrm_state.c
lib/libnetlink.c
tc/tc_class.c
tc/tc_filter.c
tc/tc_qdisc.c