]> The Tcpdump Group git mirrors - libpcap/commitdiff
Merge pull request #1090 from randomkny/fix-enobufs
authorGuy Harris <[email protected]>
Sun, 6 Aug 2023 07:51:28 +0000 (00:51 -0700)
committerGitHub <[email protected]>
Sun, 6 Aug 2023 07:51:28 +0000 (00:51 -0700)
nflog: only increment packets_nobufs when recv() returns an error

pcap-netfilter-linux.c

index bc1f106ba380f6b16371dd775a061ea64c44131e..018d3b89b90e47e2325f4bbbb0379b2b78825519 100644 (file)
@@ -123,7 +123,7 @@ netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_c
                                handle->break_loop = 0;
                                return PCAP_ERROR_BREAK;
                        }
-                       if (errno == ENOBUFS)
+                       if (len == -1 && errno == ENOBUFS)
                                handlep->packets_nobufs++;
                } while ((len == -1) && (errno == EINTR || errno == ENOBUFS));