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)
}
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));
}