From: Victor Julien Date: Wed, 3 Oct 2018 20:50:02 +0000 (+0200) Subject: afpacket: fix formatting of errors X-Git-Tag: suricata-4.1.0-rc2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efbb5ce0fe9555011f8b133bfed7ec86a4562bf2;p=thirdparty%2Fsuricata.git afpacket: fix formatting of errors --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index 438feff606..c49da267df 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -1546,7 +1546,7 @@ TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot) if (recv(ptv->socket, &c, sizeof c, MSG_PEEK) != -1) continue; /* what, no error? */ SCLogError(SC_ERR_AFP_READ, - "Error reading data from iface '%s': (%d" PRIu32 ") %s", + "Error reading data from iface '%s': (%d) %s", ptv->iface, errno, strerror(errno)); AFPSwitchState(ptv, AFP_STATE_DOWN); continue; @@ -1569,7 +1569,7 @@ TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot) case AFP_READ_FAILURE: /* AFPRead in error: best to reset the socket */ SCLogError(SC_ERR_AFP_READ, - "AFPRead error reading data from iface '%s': (%d" PRIu32 ") %s", + "AFPRead error reading data from iface '%s': (%d) %s", ptv->iface, errno, strerror(errno)); AFPSwitchState(ptv, AFP_STATE_DOWN); continue; @@ -1592,7 +1592,7 @@ TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot) TmThreadsCaptureInjectPacket(tv, ptv->slot, NULL); } else if ((r < 0) && (errno != EINTR)) { - SCLogError(SC_ERR_AFP_READ, "Error reading data from iface '%s': (%d" PRIu32 ") %s", + SCLogError(SC_ERR_AFP_READ, "Error reading data from iface '%s': (%d) %s", ptv->iface, errno, strerror(errno)); AFPSwitchState(ptv, AFP_STATE_DOWN);