From 9fd0c71f23d8c6dfecd5394d961fdf97296a3610 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Tue, 12 May 2009 22:58:25 -0700 Subject: [PATCH] Fix return value call on send() when sending NetFlow messages. When sending NetFlow messages, we use the send() call, but were checking the wrong return value. It would report an error when any non-zero value was returned. The send() call returns the number of bytes sent or -1 on error. Thus, whenever a NetFlow message was sent, it would generate an error message. Now, we only log a message when a value of -1 is returned. (Bug #1166) --- secchan/netflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secchan/netflow.c b/secchan/netflow.c index 7c16facb..16abed94 100644 --- a/secchan/netflow.c +++ b/secchan/netflow.c @@ -242,7 +242,7 @@ netflow_run(struct netflow *nf) } for (i = 0; i < nf->n_fds; i++) { - if (send(nf->fds[i], nf->packet.data, nf->packet.size, 0)) { + if (send(nf->fds[i], nf->packet.data, nf->packet.size, 0) == -1) { VLOG_WARN_RL(&rl, "netflow message send failed: %s", strerror(errno)); } -- 2.30.2