Skip to content

Commit 4b753ae

Browse files
authored
Merge pull request #1090 from randomkny/fix-enobufs
nflog: only increment packets_nobufs when recv() returns an error
2 parents 766b607 + 3fd1144 commit 4b753ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pcap-netfilter-linux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_c
123123
handle->break_loop = 0;
124124
return PCAP_ERROR_BREAK;
125125
}
126-
if (errno == ENOBUFS)
126+
if (len == -1 && errno == ENOBUFS)
127127
handlep->packets_nobufs++;
128128
} while ((len == -1) && (errno == EINTR || errno == ENOBUFS));
129129

0 commit comments

Comments
 (0)