From: Justin Pettit Date: Wed, 13 May 2009 05:58:25 +0000 (-0700) Subject: Fix return value call on send() when sending NetFlow messages. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fd0c71f23d8c6dfecd5394d961fdf97296a3610;p=openvswitch 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) --- 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)); }