Patchwork [conntrack-tools] conntrack: flush stdout for each expectation event, too

login
register
mail settings
Submitter Florian Westphal
Date May 18, 2012, 11:36 a.m.
Message ID <1337341009-15287-1-git-send-email-fw@strlen.de>
Download mbox | patch
Permalink /patch/160099/
State Accepted
Headers show

Comments

Florian Westphal - May 18, 2012, 11:36 a.m.
else, piping "conntrack -E expect" output will be buffered/delayed,
which is not what users expect. Normal conntrack events are already
flushed.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 src/conntrack.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Pablo Neira - May 20, 2012, 8:21 p.m.
On Fri, May 18, 2012 at 01:36:49PM +0200, Florian Westphal wrote:
> else, piping "conntrack -E expect" output will be buffered/delayed,
> which is not what users expect. Normal conntrack events are already
> flushed.

applied, thanks Florian.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/src/conntrack.c b/src/conntrack.c
index b065211..0920bc5 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -1380,6 +1380,7 @@  static int event_exp_cb(enum nf_conntrack_msg_type type,
 
 	nfexp_snprintf(buf,sizeof(buf), exp, type, op_type, op_flags);
 	printf("%s\n", buf);
+	fflush(stdout);
 	counter++;
 
 	return NFCT_CB_CONTINUE;