af-packet: fix problem introduced in recent commit

Logic of patch 98e4a14f6d was correct
but implementation is wrong because TP_STATUS_KERNEL is equal to
zero and thus can not be evaluated in a binary operation. This patch
updates the logic by doing two tests.

Reported-by: Alessandro Guido
pull/780/head
Eric Leblond 11 years ago
parent d06a193012
commit 82a2dd859b

@ -723,7 +723,7 @@ int AFPReadFromRing(AFPThreadVars *ptv)
SCReturnInt(AFP_FAILURE);
}
if (h.h2->tp_status & (TP_STATUS_KERNEL|TP_STATUS_USER_BUSY)) {
if ((! h.h2->tp_status) || (h.h2->tp_status & TP_STATUS_USER_BUSY)) {
if (read_pkts == 0) {
if (loop_start == -1) {
loop_start = ptv->frame_offset;

Loading…
Cancel
Save